ruby - Undefined methods using strings to populate inputs in Rails -


I am trying to pass a string from a variable in my rails app in the database. This is the user's email address. I can not understand why I am getting an "undefined method merge" error for my life.

Here is the offending code:

  & lt;% = F.email_field: Commenter, current_user.email%>   

Any help will definitely help Cheers!

Rails expect that the second argument is a hash, so that you want to do

     

or better now A, set the : commenter attribute in that particular model (after you have been flushing / creating) in the controller, you can leave this value hax. That way, when using this , Then post the form, and get a verification error, the value will be the users who were posting, current_user.email no.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -