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)
|
@lang = find_lang(@site)
|
||||||
@template = find_template(@site)
|
@template = find_template(@site)
|
||||||
@post = Post.new(site: @site, lang: @lang, template: @template)
|
@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
|
if @post.save
|
||||||
redirect_to site_posts_path(@site, lang: @lang)
|
redirect_to site_posts_path(@site, lang: @lang)
|
||||||
|
@ -79,7 +79,7 @@ class PostsController < ApplicationController
|
||||||
repair_nested_params(value)
|
repair_nested_params(value)
|
||||||
else
|
else
|
||||||
obj[key] = value.values
|
obj[key] = value.values
|
||||||
value.values.each {|h| repair_nested_params(h) }
|
obj[key].each {|h| repair_nested_params(h) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue