Rails 3 helper method not called

While I was trying to port one application from Rail 2 to Rails 3 I’ve
noticed that helper methods used for rewriting URL paths are not
called. Methods are defined in app/helpers/url_helper.rb:

module UrlHelper
def story_pah(story)

This method, when called inside of view instead of:


creates path


I order to double check this I’ve create two new applications. One in
Rails 2 and the other in Rails 3. After that I created scaffold for

Rails 2: script/generate scaffold Story title:string body:string
Rails 3: rails g scaffold Story title:string body:string

Finally I created app/helpers/url_helper.rb with above method in both
applications. In app/views/stories/index.html.erb file line:

<%= link_to 'Show', story %>

creates: story/story_title in Rails 2 and story/1 path in Rails 3.
Obviously method story_path is not called in Rails 3. Any hint why
this happens would be appreciated.

Boško Ivanišević

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs