Reputation: 138
I want to save in the method model those values but it doesnt save. I dont know if i've to use text_field_tag or something else.
View:
<div class="field">
<%= f.label 'Nemónico' %>
<%= f.text_field :nemo %>
</div>
Controller:
n = params[:nemo]
Change.saveHist(current_user.email,n,DateTime.now.to_date)
Model:
def self.saveHist(session,nemo,date)
h = DawHist.create(hsesion: session, hregnemo: nemo,hdate: date)
end
Upvotes: 0
Views: 599
Reputation: 1060
According to your posted params, you need to use the model's name (Register
in your case I guess)
Therefore, when you use params[:register][:nemo]
, you should be fine.
Upvotes: 2