Actions with dashes


This article is obsolete. You may find it’s replacement at Actions With Dashes – updated

Want to get an action with a dash in it’s name and still do something useful ? Try this:

1 class WelcomeController < ApplicationController
2 define_method("sign-up".to_sym) do
3 if then
4 # Do something
5 end
6 end
7 end

Of course, if you don’t have anything to do, just name the view file appropriately: app/views/welcome/sign-up.rhtml.


Your Host

A picture of me

I am François Beausoleil, a Ruby on Rails and Scala developer. During the day, I work on Seevibes, a platform to measure social interactions related to TV shows. At night, I am interested many things. Read my biography.

Top Tags

Books I read and recommend


Projects I work on

Projects I worked on