controller ‘ads’ do @ads = Ad.find(:all)
<% end %>
I am getting routing error. Please help on solving this error.
No route matches [GET] “/MeBay”
No route matches [GET] “/show/ads/3”
please note:other scaffolding project that I created in RoR runs well. but
not this one. please help where I went wrong.
Firstly don’t use Rails 3 as it is not only obsolete but will go out
of support within a few months. As a beginner I suggest you work
right through a good tutorial (which uses the latest rails) such as railstutorial.org (which is free to use online). That will show you
the basics or Rails.
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. As I said work
through the tutorial before going further.
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.
On 6 September 2015 at 15:00, tamouse pontiki [email protected]
wrote:
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.