I have generated a model using scaffolding.
rails g scaffold attendance ename:string entertime:datetime sl:boolean mrgsl:boolean evesl:boolean halfday:boolean
now i want to show this using simple_form, and i want to make these relationships between them:
sl--> has two types i) mrgsl. ii) evesl.
so when sl (check_box) is chosen it then show two radio_buttons and either of two is selected. and halfday is also a check_box.
<%= simple_form_for @attendance, :html => { :class => 'form-horizontal' } do |f| %>
<%= f.input :ename %>
<%= f.input :entertime, as: :time %>
<%= f.input :sl, as: :check_box %>
<%= f.input :mrgsl, as: :radio_button %>
<%= f.input :evesl, as: :radio_button %>
<%= f.input :halfday, as: :check_box %>
<div class="form-group">
<div class='col-md-offset-2 col-md-10'>
<%= f.submit nil, :class => 'btn btn-primary' %>
<%= link_to t('.cancel', :default => t("helpers.links.cancel")),
attendances_path, :class => 'btn btn-default' %>
</div>
</div>
<% end %>
this is how im trying to do it but it doesnot work,.
RuntimeError in Attendances#new
Showing /home/pallavsharma/Workspace/crm/app/views/attendances/_form.html.erb where line #4 raised:
No input found for check_box
1<%= simple_form_for @attendance, :html => { :class => 'form-horizontal' } do |f| %>
2<%= f.input :ename %>
3<%= f.input :entertime, as: :time %>
4<%= f.input :sl, as: :check_box %>
5<%= f.input :mrgsl, as: :radio_button %>
6<%= f.input :evesl, as: :radio_button %>
7<%= f.input :halfday, as: :check_box %>
what are the possible ways to do it.