ruby on rails - Problems with custom submit in FormBuilder -
i'm writing custom formbuilder, , don't understand why output of method below
def submit(label = "save changes", *args) options = args.extract_options! new_class = options[:class] || "btn btn-small btn-success" @template.content_tag(:div, :class => "form-actions left") @template.content_tag(:button, :class => new_class, :name => 'commit', :type => 'submit', :value => label) @template.content_tag(:i, :class => 'icon-arrow-right icon-on-right') end end end
is:
<div class="form-actions left"> <button class="btn btn-small btn-success" name="commit" type="submit" value="salvar"> <i>{:class=>"icon-arrow-right icon-on-right"} </i> </button> </div>
especially "i" tag. how can fix it? thanks.
so if content_tag gets block, block result used content of tag. without block, second parameter content. want is
@template.content_tag(:i, nil, :class => 'icon-arrow-right icon-on-right')
Comments
Post a Comment