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...) Rails:3.0.7 Thanks in advance. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 14 June 2011 07:19, amritpal pathak <amritpalpathak1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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. Have a look in the log to see what it says when you click the buttons. Post the relevant sections here if you cannot see what is wrong. Colin -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Tue, Jun 14, 2011 at 3:46 AM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 14 June 2011 07:19, amritpal pathak <amritpalpathak1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 14 June 2011 16:32, amritpal pathak <amritpalpathak1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On Tue, Jun 14, 2011 at 3:46 AM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: >> >> On 14 June 2011 07:19, amritpal pathak <amritpalpathak1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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" > endI am sorry Amritpal (or John, if that is your name) I give up. You still seem to have not idea how routing works. I have advised on numerous occasions that you study the Rails Guide on routing and ask here if there is something you do not understand. You have never (as far as I recall) asked for clarification on any of the details in the guide so presumably you understand it all, yet you obviously have no idea. Either you are winding us up or you need to seriously consider a different hobby (or career, but hopefully it is just a hobby). Sorry again Colin -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Tue, Jun 14, 2011 at 12:09 PM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 14 June 2011 16:32, amritpal pathak <amritpalpathak1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > On Tue, Jun 14, 2011 at 3:46 AM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > wrote: > >> > >> On 14 June 2011 07:19, amritpal pathak <amritpalpathak1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > 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 > > I am sorry Amritpal (or John, if that is your name) I give up. You > still seem to have not idea how routing works. I have advised on > numerous occasions that you study the Rails Guide on routing and ask > here if there is something you do not understand. You have never (as > far as I recall) asked for clarification on any of the details in the > guide so presumably you understand it all, yet you obviously have no > idea. > > Either you are winding us up or you need to seriously consider a > different hobby (or career, but hopefully it is just a hobby). > > Sorry again > But sir this time i read the guides but didnt get solution to my > problem.Thats why i asked here. >-- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Jun 14, 11:32 am, amritpal pathak <amritpalpath...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > 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"root :to =>" is used to denote the HOME PAGE of your application. Further, you''re going against Rails convention if you really have actions like "click1" and "click2". Please read through and understood Rails Routing properly. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Possibly Parallel Threads
- How to run the application Rubyonrails's on the server (localhost)
- (Unable to start rails application) ruby scipt/server error
- NoMethodError in Book
- best references (tutorials & howtos) for an experienced Rails Developer to start building Facebook Apps with RoR?
- Unable to start rail application at localhost