rockit
rockit

Reputation: 3796

how can I make an input field "readonly" using haml?

Im a haml newbie

Im trying to figure out how to make an html "input" field for "id", readonly using haml.

the html, should read something like this (not exact reflection)

but the readonly value never comes through

%h2 Sections
= semantic_form_for @section do |f|
  = f.inputs do
    = f.input :id, :readonly => "true"      <-----problem 
    = f.input :title

what am I missing

Upvotes: 0

Views: 3843

Answers (1)

BroiSatse
BroiSatse

Reputation: 44715

Try:

= f.input :id, input_html: { readonly: true }

Upvotes: 4

Related Questions