Ruby on Rails Saturday, September 1, 2012

> It's a feature of Rails. It's a problem if it causes problems.

(Note: nothing in this post has anything to do with rspec.)

For me, that routing behavior is causing problems. Here's why: if I add
a route such as:

get "static_pages/dog"

...and then enter the url http://localhost:3000/static_pages/dog in my
browser, rails complains that there's no action called dog in the
StaticPagesController:

===
Unknown action

The action 'dog' could not be found for StaticPagesController
===

Then if I add the dog action to the controller, then create a view,
everything works fine and dandy.

But if I then delete the dog action, and then use the same url,
http://localhost:3000/static_pages/dog, in my browser, this time I get a
different result--instead of getting an error the view displays. For
me, that inconsistent behavior is not right, and it should not be that
way. So I want to know whether there were reasons for the rails team
to institute that inconsistent behavior, or whether it is a bug.

--
Posted via http://www.ruby-forum.com/.

--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment