Skip to content

Instantly share code, notes, and snippets.

@sarony
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sarony/90d87f24f3839819ca63 to your computer and use it in GitHub Desktop.
Save sarony/90d87f24f3839819ca63 to your computer and use it in GitHub Desktop.
// migration.rb
class AddTransactionsToRsvp < ActiveRecord::Migration
def change
add_column :rsvps, :transactions, :string, array: true, default: []
end
end
// gig_post_helper.rb
def duration_tag_collection
GigPost::DURATION_TAGS.each_with_index.collect { |tag, index| [tag, tag.gsub(" ", "_")] }
end
// view/new_gig_post.html.erb
<%= select_tag("tags[duration]", options_for_select(duration_tag_collection), :prompt => "-- pick a duration --") %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment