Thanks a lot, Rayan. You do great job with RailsCasts. This website is the most useful source about rails.
Anyway, function load_and_authorize_resource not works properly with Rails4. There is ForbiddenAttributesError generated sometimes. To solve it we should type this code into our applicationController
ruby
before_filter doreturnif !(request.post? or request.patch? or request.put?)
resource = controller_path.singularize.gsub('/', '_').to_sym
method = "#{resource}_params"
params[resource] &&= send(method) if respond_to?(method, true)
end
Thanks a lot, Rayan. You do great job with RailsCasts. This website is the most useful source about rails.
Anyway, function
load_and_authorize_resource
not works properly with Rails4. There isForbiddenAttributesError
generated sometimes. To solve it we should type this code into our applicationController