jeudi 26 décembre 2019

how can i get mm/yy output while use of 'form.date_select :date' in rails

i want to acess date in mm/yyyy format on show page but it gives output as {1=>2019, 2=>2, 3=>1}. how can i make output as {1=>2019, 2=>2, 3=>1} to mm/yy format in user view page.

form.html.erb

          <div clas="field medium-6 columns">
        <%= form.label :attendance_month %>
        <%= form.date_select :date, { :discard_day => true, :discard_month => false, :discard_year => false } %>
      </div>

show.html.erb

<%= project_site.date %>

Aucun commentaire:

Enregistrer un commentaire