I just can't get things right inside button_to. What is wrong with the following code? I get the error message missing required keys: [:callsign].
Attempt 1:
<%= button_to messages_user_path,
callsign: @character.callsign,
params: {
recipient_callsign: notice.character.callsign
},
class: 'btn btn-default btn-xs post_button',
id: 'message_envelope' do %>
<span class="glyphicon glyphicon-envelope" aria-hidden="true"></span>
<% end %>
This also fails with the same error message: Attempt 2:
<%= button_to messages_user_path(
params: {
callsign: @character.callsign,
recipient_callsign: notice.character.callsign
}
),
class: 'btn btn-default btn-xs post_button',
id: 'message_envelope' do %>
<span class="glyphicon glyphicon-envelope" aria-hidden="true"></span>
<% end %>
This version shows the page, but it doesn't hide the recipient_callsign, which can be seen in the url. This defeats the object of using button_to in the first place because I don't want recipient_callsign in the url. Why doesn't it hide recipient_callsign?
Attempt 3:
<%= button_to messages_user_path(
callsign: @character.callsign,
params: {
recipient_callsign: notice.character.callsign
}
),
class: 'btn btn-default btn-xs post_button',
id: 'message_envelope' do %>
<span class="glyphicon glyphicon-envelope" aria-hidden="true"></span>
<% end %>