Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 6th, 2012  |  syntax: None  |  size: 0.26 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Is there a way, in Rails, to get the correct url for a form when the model doesn't match the controller?
  2. = form_for(@user, :url => @user.new_record? ? managers_url : manager_url(@user))
  3.        
  4. class Manager < User
  5.   default_scope where(:role => "manager")
  6. end