This should be everyone's starting point when first learning about Rails
routing: http://guides.rubyonrails.org/routing.html

Read it a couple of times at least.  If you're still unsure, at least you'll
have enough context to come back and ask specific questions about the parts
you don't understand.

On Sun, May 29, 2011 at 10:01 AM, Stefano <[email protected]> wrote:

> I think I can speak for most people (yeah notice the most, didnt want
> to speak for everybody) here in saying, no we cant.
>
> On May 29, 6:51 am, amritpal pathak <[email protected]> wrote:
> > On Sat, May 28, 2011 at 12:30 PM, Frederick Cheung <
> >
> >
> >
> >
> >
> > [email protected]> wrote:
> >
> > > On May 28, 3:06 pm, amritpal pathak <[email protected]> wrote:
> > > > Hey
> > > >       I am using rails 3.0.7.I created two buttons simply as:
> > > >      <%= button_to "Great", :action => "click"%>
> > > >      <%= button_to "click me", :action => "work"%>
> >
> > > > Router.rb file looks like:
> >
> > > > Check::Application.routes.draw do
> > > >  # get "gne/clg"
> >
> > > >   get "posts/index"
> > > >   resources :posts do
> > > >    end
> > > > #get 'posts/click'
> >
> > > > ActionController::Routing::Routes.draw do |map|
> > > > map.root :controller => "posts", :action => "click"
> > > > end
> >
> > > > ActionController::Routing::Routes.draw do |map|
> > > > map.root :controller => "posts", :action => "work"
> > > > end
> > > >  end
> >
> > > First off you don't need that ActionController::Routing::Routes.draw
> > > stuff if you use the rails 3 syntax.
> > > root :to => "posts#click"
> >
> >      Thanks for help.It worked.
> >
> >
> >
> > > Secondly you're mapping both your actions to the same path - you need
> > > to map them to different paths if you want rails to know which action
> > > to route to when the request arrives.
> >
> >      Can you tell please how to map both actions to different paths.I
> >      am new to rails so dont know OR any good tutorial that can help.
>
> --
> 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.
>
>

-- 
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.

Reply via email to