5
0
Fork 0
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:
f 2018-07-27 11:22:08 -03:00
parent 4a66a3ca35
commit b76ac00206
No known key found for this signature in database
GPG key ID: F3FDAB97B5F9F7E7

View file

@ -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