my service layer files are located in app/services/domain,
app/services/application and app/services/infrastructure. I'm using
services in active admin controller section. When validation fail it can't
redirect correctly, it keeps throwing me ActiveRecord::RecordInvalid. Here
is the error page:
And here is the category service:
category = Category.new(params)
In finally here is the my controller:
category = Service::CategoryService.create(params[:category])
flash[:notice] = "Category was successfully created."
redirect_to params[:button] == "create_and_new" ? new_admin_category_url : admin_categories_url
end # end controller
How to solve it? Please help me.
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/2RMlTx36pRAJ.
To post to this group, send email to firstname.lastname@example.org.
To unsubscribe from this group, send email to email@example.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.