Last active
August 29, 2015 14:03
-
-
Save allenwlee/c35f3cc4d23a3a61b9bd to your computer and use it in GitHub Desktop.
Revisions
-
allenwlee revised this gist
Jul 10, 2014 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1 +1,3 @@ {"utf8"=>"✓", "_method"=>"patch", "project"=>{"id"=>"1913", "name"=>"Turquoise Girder", "genres_projects_attributes"=>{"genre_id"=>["11"]}, "logline"=>"", "synopsis"=>"", "imdb_link"=>"", "status"=>""}, "commit"=>"Update", "attribute"=>"profile", "controller"=>"projects", "action"=>"attribute_edit"} {"utf8"=>"✓", "_method"=>"patch", "user"=>{"username"=>"STUDIOCOMPS", "given_name"=>"ALLEN", "family_name"=>"LEE", "production_media_users_attributes"=>[{"production_medium_id"=>["2"]}], "experience1"=>"Lions Gate Entertainment", "experience2"=>"", "education1"=>"Columbia MBA", "education2"=>"UC Berkeley", "linkedin_url"=>"http://www.linkedin.com/in/...", "bio"=>"..."}, "commit"=>"Update Profile", "action"=>"update", "controller"=>"users", "id"=>"91"} -
allenwlee revised this gist
Jul 10, 2014 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ {"utf8"=>"✓", "_method"=>"patch", "project"=>{"id"=>"1913", "name"=>"Turquoise Girder", "genres_projects_attributes"=>{"genre_id"=>["11"]}, "logline"=>"", "synopsis"=>"", "imdb_link"=>"", "status"=>""}, "commit"=>"Update", "attribute"=>"profile", "controller"=>"projects", "action"=>"attribute_edit"} -
allenwlee revised this gist
Jul 10, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ def user_params params.fetch(:user, {}).permit(:id, :production_media_users_attributes: [:id, :user_id, {production_medium_id: []}]) end def project_params -
allenwlee revised this gist
Jul 10, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,3 @@ <%= select_tag 'user[production_media_users_attributes][][production_medium_id][]', options_for_select(ProductionMedium.order(:id).collect{|g| [g.name, g.id]}), { include_hidden: true, multiple: true, required: true, placeholder: 'Choose One or More', class: 'form-control menu-select2'} %> <%= select_tag 'project[genres_projects_attributes][][genre_id][]', options_for_select(Genre.order(:id).collect{|g| [g.name, g.id]}), { include_hidden: true, multiple: true, required: true, placeholder: 'Choose One or More', class: 'form-control menu-select2'} %> -
allenwlee revised this gist
Jul 10, 2014 . 2 changed files with 26 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ class User < ActiveRecord::Base has_many :production_media, through: :production_media_users has_many :production_media_users accepts_nested_attributes_for :production_media_users end class ProductionMedium < ActiveRecord::Base has_many :users, through: :production_media_users has_many :production_media_users end class Project < ActiveRecord::Base has_many :genres, through: :genres_projects has_many :genres_projects accepts_nested_attributes_for :genres_projects end class Genre < ActiveRecord::Base has_many :projects, through: :genres_projects has_many :genres_projects 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ <%= select_tag 'project[genres_projects_attributes][][genre_id][]', options_for_select(Genre.order(:id).collect{|g| [g.name, g.id]}), { include_hidden: true, multiple: true, class: 'form-control'} %> <%= select_tag 'project[genres_projects_attributes][][genre_id][]', options_for_select(Genre.order(:id).collect{|g| [g.name, g.id]}), { include_hidden: true, multiple: true, required: true, placeholder: 'Choose One or More', class: 'form-control menu-select2'} %> -
allenwlee created this gist
Jul 10, 2014 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ def user_params params.fetch(:user, {}).permit(:id, :roduction_media_users_attributes: [:id, :user_id, {production_medium_id: []}]) end def project_params params.fetch(:project, {}).permit(:id, genres_projects_attributes: [:id, :project_id, {genre_id: []}]) end