Skip to content

Instantly share code, notes, and snippets.

@abrambailey
Created February 15, 2013 21:15
Show Gist options
  • Save abrambailey/4963601 to your computer and use it in GitHub Desktop.
Save abrambailey/4963601 to your computer and use it in GitHub Desktop.
<% provide :title, 'Consumer Profile | Update' %>
<legend>Update your Profile</legend>
<%= simple_form_for @consumer, :html => { :class => 'cons_edit form-horizontal' } do |f| %>
<%= f.input :display_name, :label => "Public name", :placeholder => @consumer.user.username %>
<%= f.input :tagline, :placeholder => "Your tagline" %>
<%= f.input :tag_list, :label=>"Activities", :input_html => { :multiple => true } %>
<%= f.input :desc, :as=> "text", :label => "Description", :placeholder => "Describe yourself" %>
<div class="controls">
<%= f.button :submit, "Update Profile" %>
</div>
<% end %>
<% @tags = [] %>
<% ActsAsTaggableOn::Tag.all.each do |tag| %>
<% @tags << tag.name %>
<% end %>
<script>
$(document).ready( function () {
$("#consumer_tag_list").select2({tags:[
<% @tags.each do |tag| %>
<% if tag.equal? @tags.last %>
<%= "'#{tag}'".html_safe %>
<% else %>
<%= "'#{tag}',".html_safe %>
<% end %>
<% end %>
]});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment