1

) I am quite new in Ruby so please be indulgent ;-)

I am trying to set up the sign in form within a bootstrap modal but I am keeping the same message errore as it follow : NameError in Pages#home

Showing /Users/raphaelbendenoun/code/isrcovoit/app/views/pages/home.html.erb where line #78 raised:

undefined local variable or method `resource' for #<#:0x00000101366738> Extracted source (around line #78):

75:     <h3> id="myModalLabel">Modal header</h3>
76:   </div>
77:   <div class="modal-body">
78:     <%= simple_form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => {:class => 'form-horizontal'}) do |f| %>
79:           <div class="inputs">
80:             <%= f.input :email, :required => false, :autofocus => true %>
81:             <%= f.input :password, :required => false %>
Rails.root: /Users/raphaelbendenoun/code/isrcovoit

Application Trace | Framework Trace | Full Trace app/views/pages/home.html.erb:78:in `_app_views_pages_home_html_erb__571334819088820889_2157665500'

Here is my code :

 <!-- Modal -->
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-header">
    <button type="button" class="close"  aria-hidden="true">×</button>
    <h3> id="myModalLabel">Modal header</h3>
  </div>
  <div class="modal-body">
    <%= simple_form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => {:class => 'form-horizontal'}) do |f| %>
          <div class="inputs">
            <%= f.input :email, :required => false, :autofocus => true %>
            <%= f.input :password, :required => false %>
            <%= f.input :remember_me, :as => :boolean if devise_mapping.rememberable? %>
          </div>
  </div>
    <div class="modal-footer">
        <%= f.button :submit, "Sign in", :class => 'btn btn-primary', :data => { :dismiss => "modal"} %>
        <% end %>
    </div>
</div>

What am I missing ?? Thx so much for the help, all the tips are welcomed

Ben2pop
  • 746
  • 1
  • 10
  • 26

0 Answers0