Tamik Soziev
Tamik Soziev

Reputation: 14798

How to disable all elements on form with rails 3?

I have a partial which includes a form, i have two different instances where i want to use this form, one if for editing and another one if for viewing only, i want to disable all of the fields in a second case. Is there any quick way to do it in rails? I know i can do it with jquery but i prefer to do it in rails.

Upvotes: 0

Views: 888

Answers (1)

mikdiet
mikdiet

Reputation: 10018

You can wrap all elements in with_options :disabled => 'disabled' do method.

Upvotes: 2

Related Questions