CodeSnips
Collections
Coders
Sign in
Join us today
Share your craft projects Make new craft buddies Ask craft questions Blog your craft journey

Martin Sojka

25 code snips and 4 followers
in 6 months
Follow

More from Martin Sojka

Fetching notifications on click while showing pulsating placeholders with htmx and hyperscript on Rails Post like / unlike with htmx on Rails - partial replacement, server-side rendering Authorization concerns for models and controllers in Ruby on Rails Search users as you type in Ruby on Rails with htmx
RSS
1
0

Accepting nested attributes in Ruby on Rails

436 views
0 comments
                  has_many :code_blocks

accepts_nested_attributes_for :code_blocks, reject_if: :all_blank, allow_destroy: true
                
                  def code_snip_params
  params[:code_snip].permit(
    code_blocks_attributes: [:id, :name, :code, :language, :_destroy]
  )
end
                

Martin Sojka, Maker of CodeSnips

ruby-on-rails ruby

0 Comments

Follow comments

More from Martin Sojka

Fetching notifications on click while showing pulsating placeholders with htmx and hyperscript on Rails Post like / unlike with htmx on Rails - partial replacement, server-side rendering Authorization concerns for models and controllers in Ruby on Rails Search users as you type in Ruby on Rails with htmx
RSS
CodeSnips

CodeSnips is crafted with passion and great attention to detail.

We are 13 coders making 7 comments on 33 code snips.

Privacy Terms
Facebook Instagram Pinterest
Collections Coders Tags

© 2024 CodeSnips. All Rights Reserved. Running on Ruby on Rails.

Disclaimer: Any posts on CodeSnips.io are posted by individuals acting in their own right and do not necessarily reflect the views of CodeSnips.
CodeSnips will not be held liable for the actions of any user.