Hi all,
I have a custom method in my controller called ‘generate’.
when requested localhost:3000/import/generate I see “Couldn’t find
Import with ID=generate”.
How customize a route for this method?
help please…
Hi all,
I have a custom method in my controller called ‘generate’.
when requested localhost:3000/import/generate I see “Couldn’t find
Import with ID=generate”.
How customize a route for this method?
help please…
On Wed, 6 May 2009 08:27:42 -0700 (PDT)
flaubert [email protected] wrote:
Hi all,
I have a custom method in my controller called ‘generate’.
when requested localhost:3000/import/generate I see “Couldn’t find
Import with ID=generate”.How customize a route for this method?
map.connect ‘/import/generate/’, :controller => ‘import’, :action =>
‘generate’
–
Starr H.
Check out my Helpdesk RailsKit: http://railskits.com/helpdesk/
do i have to use this for any custom method that a have created?
there isn’t any dryer solution for this?
tnks for reply!
On Wed, 6 May 2009 08:38:07 -0700 (PDT)
flaubert [email protected] wrote:
do i have to use this for any custom method that a have created?
there isn’t any dryer solution for this?
The dryer solution is to use map.resource & restful urls for most
actions, and use non-restful actions sparingly.
–
Starr H.
Check out my Helpdesk RailsKit: http://railskits.com/helpdesk/
try to put into config/routes.rb:
map.connect ‘:controller/:action’
after:
map.connect ‘:controller/:action/:id’
map.connect ‘:controller/:action/:id.:format’
final result:
map.connect ‘:controller/:action/:id’
map.connect ‘:controller/:action/:id.:format’
map.connect ‘:controller/:action’
Hope this helps…
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs