SHARE
TWEET

Untitled

a guest Sep 15th, 2019 105 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. params.require(:resource).permit(:title, :description, :challenge, :weight, :status, :subject_primary, :subject_secondary, :subject_tertiary, :concept_primary, :concept_secondary, :material_type, :media_type, :cover_image, :resource_group_id, :content, *Resource.globalize_attribute_names, grade_level: [], extra_data: [:embed_code, :embed_platform, :external_link, :buzz_id, :domainid, :libraryid])
  2.  
  3. Resource model
  4. belongs_to :resource_group, optional: true
  5.  
  6. Resource Group Model
  7.  has_many :resources
  8.  
  9.  
  10.  resource form:
  11.  .columns  
  12.     .column
  13.       %fieldset
  14.         .field
  15.           = f.label :resource_group_id, t("helpers.label.resource.resource_group"), class: 'label'
  16.           .control
  17.             .select.is-fullwidth
  18.               = f.collection_select :resource_group_id, ResourceGroup.all, :id, :name, include_blank: true, prompt: t("admin.resources.select_options_resource_group")
  19.              
  20.              
  21.  
  22.   def change
  23.     add_reference :resources, :resource_group
  24.   end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top