Setting a variable for view

If this specific issue as what you're addressing, how about:

if @my_model_object.new_record?
   # do new code
else
   # do edit code
end

of if you are just changing the button names, use something like:

<%= submit_button(my_model_object.new_record? ? 'add new' : 'update
now') %>

Yes?