So I am familiarising myself with both rails and of course rails 4.
So this is what I have at the bottom of my controller
def post_params
params.re
The strong_params function is just about giving your controller a "whitelist" of variables to work with. It's really for security purposes, and literally just means that your app can access params[:permitted_param] to save the data.
There are 2 things you could do:
--> Edit the params[:category] variable before you call the post_params function:
def create
params[:category].downcase
@post = Post.new(post_params)
@post.save
end
--> You could use the before_create function as recommended by @thiyaram too :)