E
E
eldar_web2015-05-26 11:42:58
Ruby on Rails
eldar_web, 2015-05-26 11:42:58

How in Rails in CRUD-e in the form to change the text of the button to "save" if edit?

There is a default form _form - for adding and editing.
By default, the button text is 'submit', what is the condition to set to find out if it is create or edit?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton Ivanov, 2015-05-26
@eldar_web

If the form is for a model object, then you can rely on the "new_record?"

E
Eugene Burmakin, 2015-05-26
@Freika

Put the text "Save" or "Save" and do not suffer with such a trifle.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question