1 of 3

How would you refactor this case statement?

I've got this code in my ApplicationHelper file:

def new_button
  case controller_name
  when 'ones'
    "<li class='has-form'><a class='button' href='#{new_one_path}'>New One</a></li>".html_safe
  when 'twos'
    "<li class='has-form'><a class='button' href='#{new_two_path}'>New Two</a></li>".html_safe
  when 'threes'
    "<li class='has-form'><a class='button' href='#{new_three_path}'>New Three</a></li>".html_safe

So I can just put <%= new_button %> in the view, to display the appropriate button based on the controller_name being accessed.

I have about 10 different controllers to select from (and I'm sure that collection will grow), so the code is getting a bit lengthy.

Is there a better way to accomplish this?