Forum: Ruby on Rails how to match /posts/123

Posted by S Ahmed (Guest)
on 2012-10-15 03:51
(Received via mailing list)
I have a postscontroller, with a show method:

def show
...
end


I want to match the following url pattern to this controller action:

/posts/123

Shoudl go to the postscontroller, show method with id=123
Posted by Jeffrey Jones (Guest)
on 2012-10-15 05:23
(Received via mailing list)
Have a read of this:

http://guides.rubyonrails.org/routing.html

It explains all about the rails routing system.
Posted by Colin Law (Guest)
on 2012-10-15 09:49
(Received via mailing list)
On 15 October 2012 02:50, S Ahmed <sahmed1020@gmail.com> wrote:
>
> Shoudl go to the postscontroller, show method with id=123

As I guess that you are a beginner with Rails I suggest that you work
through a good tutorial on Rails so that you will understand the basic
principles.  railstutorial.org is good and is free to use online.
Make sure that any tutorial you try is for rails 3 and make sure you
install the exact version of rails that the tutorial is based on.

Colin
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.