How to call a field in my controller

74 views Asked by At

I have a comments model, and within that model, I have a field called :honey.

In the view, :honey is a hidden form field.

In the controller, when the form posts I want it to redirect to the home page if :honey is filled out.

How do I call that specific field in my controller?

1

There are 1 answers

0
user229044 On BEST ANSWER

If you're talking about when your form posts back to your action, you should be checking params. Either look in your logs or use binding.pry and look for the key and value you're expecting.

It will probably be params[:comment][:honey].