Displaying 2 results from an estimated 2 matches for "show_someth".
2007 Apr 01
2
"-" instead of "_" in routes?
Hi all
I''d like to have minus signs "-" instead of underscores "_" in my
routes. Is there an easy to do that?
my_controller/show_something/123 # <= not cool
my-controller/show-something/123 # <= much cooler
Thanks a lot
Josh
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk"...
2005 Dec 18
0
Fromcontroller to the url_for() representation
...the link_to() params. One of the
things I need to pass is the :controller part.
So I''m in the controller itself, and I want to change the self.class
(or it''s to_s represantation) to the format needed by link_to().
For example:
class MyController < ApplicationController
def show_something
the_controller = self.class # or self.class.to_s
# here I want somethig like:
@controller_to_use = transform_to_string(the_controller)
end
end
Also, is there a way to call link_to() in a controller?
Thanks,
Guy.