Ruby on Rails Sunday, September 6, 2015


On Fri, Sep 4, 2015 at 1:21 AM, Colin Law <clanlaw@gmail.com> wrote:
On 3 September 2015 at 21:56, Priya Mohan <mmpriya66@gmail.com> wrote:
> 6.config/routes.rb
>
> controller 'ads' do
>                match 'ads/:id' => :show
>  match 'ads/:id' => :index
>        end
 
As for your specific problem it should be /ads/show/3.  Also the route
for index should not include the id.  But in routes.rb you should be
using resources rather than match for such cases.

The "show" route would just be /ads/3 : http://localhost:3000/ads/3
The "index" route is just /ads: http://localhost:3000/ads
 
  As I said work
through the tutorial before going further.

Colin

Tamara
 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAHUC_t_Bw%2B5-r6HYFCnfgiFxTyB9dKy%3DyShSEUfm%3DdDihgs%3D%3DQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment