mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-15 04:31:41 +00:00
filtrar los params tambien al crear :/
This commit is contained in:
parent
4a66a3ca35
commit
b76ac00206
1 changed files with 2 additions and 2 deletions
|
@ -35,7 +35,7 @@ class PostsController < ApplicationController
|
|||
@lang = find_lang(@site)
|
||||
@template = find_template(@site)
|
||||
@post = Post.new(site: @site, lang: @lang, template: @template)
|
||||
@post.update_attributes(post_params)
|
||||
@post.update_attributes(repair_nested_params(post_params))
|
||||
|
||||
if @post.save
|
||||
redirect_to site_posts_path(@site, lang: @lang)
|
||||
|
@ -79,7 +79,7 @@ class PostsController < ApplicationController
|
|||
repair_nested_params(value)
|
||||
else
|
||||
obj[key] = value.values
|
||||
value.values.each {|h| repair_nested_params(h) }
|
||||
obj[key].each {|h| repair_nested_params(h) }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue