Please look at the two examples below:
irb(#<ActionView::Base:0x2863d58>):030:0> paintings_path
=> "/some-nice-alias-path"
irb(#<ActionView::Base:0x2863d58>):029:0> self.controller_name.to_s + "_path"
=> "paintings_path"
How do I return the path instead of the string? I need to call the controller path from my application helper.
Best regards.
Asbjørn Morell
if you don’t use send on self, it goes to Kernel, which is what you want. self might work though, depending on exact context.