John Lahr wrote in post #1178417:
> If you are cutting and pasting exactly from your view to your HTML it
> seems
> kind of odd.
>
> The 'form group' is showing up not where you put it before the form, but
> before the input field.
> The Submit button still says submit, not update as you indicate in your
> view.
>
> Also - your missing the f.label for your form?
>
> The form control div is not something i ever used - i'd stick with the
> basics and see if that works.
>
> <%= form_for(@subscription) do |f| %>
> <%= f.label :name %>
> <%= f.text_field :name %>
> <%= f.submit "Update", class: "btn btn-primary" %>
> <% end %>
>
> Do you have any other bootstrap code on this view form and is it
> displaying
> properly?
>
> To make sure you get it everywhere you want, I'd put your bootstrap
> imports
> in the application.scss file (In current rails versions you don't need
> css.scss, just scss)
Thanks, it work the following code.
I had to replace
<%= f.submit :sample, class:"btn btn-primary" %>
with this code. the difference was submit vs button.
<%= f. button :sample, class:"btn btn-primary" %>
<%= form_for @subscription do |f| %>
<%= f.text_field :email %>
<%= f.button :sample, class:"btn btn-primary" %>
<% end %>
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/bcd509a94dd4c99428b8e402b3cde843%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment