That's the Rails way of adding a route, and will work (if you change the
name of the action to 'new_page').
To do things the rails way, you will need a 'new_page' action in your
VersionsController. This controller action would be then responsible
for setting the 'this' variable.
If you do things the Hobo way, hobo will add both the route and
controller action for you. Put this in your controller:
show_action :new_page
Bryan
On 10-06-10 10:39 AM, Pete wrote:
I am trying to create a new page within one of my models, but I think
I must have declared the routing incorrectly, as I cannot seem to call
'this' from my page.
I have set up my route as:
map.connect 'versions/:id/NewPage', :controller => 'versions', :action
=> 'NewPage'
and from the version/show page have set up the link as:
<a href="/versions/#{this.id}/NewPage">New Page Link</a>
The link works, and I'm directed to the correct page, but I cannot
seem to call the methods and/or fields from the version model using
'this' (or anything else for that matter)- I thought that by using
#{this.id} I was linking the page to the context of the current
version.id, but it does not seem to have worked?
--
You received this message because you are subscribed to the Google Groups "Hobo
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/hobousers?hl=en.