I am trying to create this controller:
def calculate
# Do some calculations here
respond_to do |format|
format.json{head status}
end
end
and I have a HAML file in which I make my HTML and in there I want to link to something like this:
=link_to("stats" , controller_path_url)
where controller_path is a rake routes path that is shown. My question is how do I make this sort of uniquely named controller function to be mapped and show its path when I do rake routes? Is there something I have to do in routes.rb? What should I change there?
Thanks!
You should do smth like following in your
routes.rbfile:then run:
and see your path.
It should be
calculcate_pathfor path andcalculate_urlfor full path.