Last active
August 29, 2015 13:57
-
-
Save axilaris/9597320 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <%= form_for(@post) do |f| %> | |
| <% if @post.errors.any? %> | |
| <div id="error_explanation"> | |
| <h2><%= pluralize(@post.errors.count, "error") %> prohibited this post from being saved:</h2> | |
| <ul> | |
| <% @post.errors.full_messages.each do |msg| %> | |
| <li><%= msg %></li> | |
| <% end %> | |
| </ul> | |
| </div> | |
| <% end %> | |
| <script> | |
| $(document).ready(function() { | |
| $('select#option').select2(); | |
| }); | |
| </script> | |
| <br><br> | |
| <div class="field"> | |
| <%= f.label :name %><br> | |
| <%= f.text_field :name %> | |
| <%= select_tag(:option, | |
| options_for_select([['All', 1], ['Co', 2], ['Bought', 3], ['View', 4], ['Top API', 5]] )) %> | |
| </div> | |
| <div class="actions"> | |
| <%= f.submit :class => "btn btn-primary" %> | |
| </div> | |
| <% end %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| *= require bootstrap | |
| *= require_tree . | |
| *= require_self | |
| *= require select2 | |
| *= require select2-bootstrap |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //= require jquery | |
| //= require jquery_ujs | |
| //= require bootstrap | |
| //= require turbolinks | |
| //= require_tree . | |
| //= require select2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| gem 'bootstrap-sass' | |
| gem 'select2-rails' |
Author
axilaris
commented
Mar 17, 2014

Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment