Users can send a reply to feedback they received. Here is the form:
<%= form_for :feedback, :url => reply_feedback_path do |f| %>
<%= f.text_area :reply, :size => '66x7' %><br>
<%= f.submit "Reply" %>
<% end %>
Here is the controller:
@reply = params[:feedback]
UserMailer.reply2_comments(@to_whom, @from_whom, @reply).deliver
If someone types in ‘yo’ into the text box, what is passed to the mailer is ‘ {“reply”=>”yo”} ‘
I’m having trouble with the syntax to extract just the content that was typed.
Thanks.
It looks like you’re passing a hash to the mailer, and you just want the value for the key “reply”. So try:
The main thing I changed here was changing
@replyto@reply['reply']in the mailer call(I also added a nil-check to the first line to make sure @reply[‘reply’] won’t cause an error if they don’t submit the form by normal means)