launchscout / nku

NKU Class Spring
5 stars 14 forks source link

2 errors URL Generation error in student/index, unknown attribute in StudentController #46

Closed Spartan-196 closed 10 years ago

Spartan-196 commented 10 years ago

Most recent commit is accessible here https://github.com/Spartan-196/nku-rails Rails host: http://atkinsonj3-72805.use1.nitrousbox.com/students

I am receiving a URL generation error when trying to go to my student index page, and i am not as of to why it thinks I have it set to require an ID when navigating there in general as its not needed until after login

urlgeneration_error most recent student index page is here https://github.com/Spartan-196/nku-rails/blob/master/app/views/students/index.html.erb

Second:

After manually navigating to http://atkinsonj3-72805.use1.nitrousbox.com/students/new and making a new user anyways trying to make the session ID kicks back saying its got an invalid attribute. unknown_attrib

ITs complaining about this line

@student = Student.new(student_params)

student parms is defined by

private
  def student_params
    params.require(:student).permit(:name, :nickname, :email, :password, :password_confirm, :image)
  end

This is the form being submitted:

<p>
      <%= f.label :name %><br> <!--Form Title Text -->
      <%= f.text_field :name %><!--Form Text field (single line) for user-->
  </p>

  <p>
      <%= f.label :nickname %><br> <!--Form Text Box Title  -->
      <%= f.text_field :nickname %><!--Form Expandable Textbox for User -->
  </p>
  <p>
    <%= f.label :email %> <br>
    <%= f.text_field :email%>
  </p>
    <p>
    <%= f.label :password %><br>
    <%= f.password_field :password %>
  </p>

  <p>
    <%= f.label :password_confirm %><br>
    <%= f.password_field :password_confirm %>
  </p>
  <p>
    <%=f.label :image %> <br>
    <%=f.text_field :image %>
  </p>
  <p class="button">
    <%= f.submit %> <!-- submit button-->
  </p>

it most definitely is passing password as also shown in the screen capture as it filters it and the confirmation one out

Spartan-196 commented 10 years ago

This was mostly a routes problem