On Tue, Jun 14, 2011 at 3:46 AM, Colin Law <[email protected]> wrote:
> On 14 June 2011 07:19, amritpal pathak <[email protected]> wrote: > > Hey > > My app has some buttons and i have route all to different > action > > in router.rb file but click on each button results in same action. why? > > Am i missing to specify anything...) > > Yes, obviously. > Show us the code for a couple of the buttons. > Buttons are generted using following code <%= button_to "Submit1", :action => "click1"%> <%= button_to "Submit2", :action => "click2"%> Similarly other buttons have been created.obviously there are files in view directory with name click1,click2 and so on. > Routing.rb file has following stuff > Check::Application.routes.draw do get "posts/index" resources :posts do end root :to => "posts#click1" root :to => "posts#click2" end Thank you -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" 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/rubyonrails-talk?hl=en.

