将链接单击到具有相同操作的页面时触发操作(VoltRb)

时间:2015-08-24 19:25:12

标签: ruby events hyperlink voltrb opalrb

http://localhost:3000/books,我有一个索引页面,我有一个书籍列表。

enter image description here

当您点击其中一个链接时,绑定它的操作book会被触发:

enter image description here

但是,当您点击其中一个书页的其中一个链接时,book操作不会被解雇:

enter image description here

请注意,从索引页面和书籍页面点击链接时,URL确实会发生变化,但我遇到的问题是book<code> // metadataRepository @Transactional public Metadata findOneById(String uuid); @Transactional public void processQueueMessages(Map<String, MessageAttributeValue> attributes ) throws IOException{ Metadata metadata = null; try{ metadata = metadataRepository.findOneById(uuid); // REST call to get list of locations GeotaggerList locationList = response.getResult(); // this call just maps fields, no database interaction Map<String, GeoLocation> locationNameMap = metadataService.getKwebLocations(locationList, null); for (Map.Entry<String, GeoLocation> entry : locationNameMap.entrySet()){ entry.getValue().setMetadata(metadata); metadata.getGeoLocations().add(entry.getValue()); //fails } metadataService.save(metadata, username); } } catch (Exception e){ e.printStackTrace(); return; } </code> 时无法激活您从另一个书页单击指向书页的链接。我怎样才能解决这种情况?

仅供参考,here is a repo可以重现此问题。

1 个答案:

答案 0 :(得分:0)

事实证明,Volt computations是解决此问题的一种方法。通过使用params集合,您可以将计算附加到URL中的更改。我解决了这个问题并让book运行了网址中的更改,如下所示:https://github.com/ylluminarious/volt_action_problems/commit/5fcefc16d7b14a980f68ce572a80f25540d21636