I used simple_form and devise (RoR gems) to make a New User and Edit User form. I added a checkbox feature so that users can select what payment methods they accept. However, after filling up and updating the form, user page generates this dashes, zeroes and other symbols while also displaying the checked items.
Example: (When I updated the form, I checked "Debit Card" and "PayPal". This is what comes out:
Payment Methods Accepted: --- - Debit Card - PayPal - ''
I know this might be a silly question, but does anyone know how I can get rid of the unnecessary symbols? I'm a complete beginner in RoR and am really struggling to understand all the codes.
For my edit.html.erb (which is also what the user visits to view the profile page), I used the following codes:
<%= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => {:method => :put, class: 'form-horizontal'}) do |f| %>
<%= f.error_notification %>
<%= f.input :name %>
Payment Methods Accepted:
<%= @user.paymode %>
<div class="checkboxes">
<p>
<%= f.collection_check_boxes :paymode, [['Cash', 'Cash'] ,['Credit Card', 'Credit Card'] ,['Debit Card', 'Debit Card'] ,['PayPal', 'PayPal']], :first, :last, {:item_wrapper_class => 'checkbox_container'} %>
</div>
This is then defined under my user.controller.rb file
class UsersController < ApplicationController
def show
@user = User.find(params[:id])
end
Also, to give a quick background: I initially attempted to implement acts_as_taggable_on with simple_form and devise so that I could eventually filter users later on by paymode (payment methods). However, this did not work out, so I just simplified it to this. I removed all tagging-related codes after that. Would this have any relation to the symbols I'm getting?
Thanks and help would be greatly appreciated!