开发者

add commit button to same fieldset as inputs in formtastic

开发者 https://www.devze.com 2023-02-12 02:46 出处:网络
How do I add my submit button into the same li as the inputs of my form? = semantic_form_for :regression_test_environments do |env|

How do I add my submit button into the same li as the inputs of my form?

= semantic_form_for :regression_test_environments do |env|
  %ul.input-list
    = env.inputs :name, :navigation, :url, :title => "New Env开发者_StackOverflow社区ironment"
    %li.commit= env.submit "Save Environment", :class => "submit"

This just puts the li outside of the fieldset with class inputs. Is there a way to include it in the fieldset(and ul)?


Does this work:

= semantic_form_for :regression_test_environments do |env|
  %ul.input-list
    = env.inputs :name => "New Environment" do
      = env.input :name
      = env.input :navigation, 
      = env.input :url 
      %li.commit= env.submit "Save Environment", :class => "submit"

I am not sure if you have a field :title or you want to name your fieldset (in which case you need to use :name).

0

精彩评论

暂无评论...
验证码 换一张
取 消