Good day.
How to add params[:controller] value in params[:comments]. (in View)
I want the comment Model will be filled with following parameters:
#comment.rb
id:
text:
commentable_id:
user_id:
controller: #for example 'posts', or 'galleries'
But a User doesn't have access to controller:
value.
controller: should be determined by default. (for example posts)
Something like there http://railscasts.com/episodes/154-polymorphic-association
but commentable_type:
is swaped with controller:
And how do you think, is it good emplemention of polymorpyc assosiation for comments ?
How emplement this solution better?