Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4087240
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:49:49+00:00 2026-05-20T18:49:49+00:00

When I click on this link in my index view: <%= link_to Edit Password,

  • 0

When I click on this link in my index view:

<%= link_to "Edit Password", edit_user_path(current_user) %>

I get this error:

NoMethodError in Users#edit

Showing /rubyprograms/dreamstill/app/views/videos/_modal.html.erb where line #3 raised:

undefined method `model_name' for NilClass:Class
Extracted source (around line #3):

1: <div id="boxes">
2: <div id="dialog" class="window">
3: <%= form_for(@video) do |f| %>

This has to do with a partial called _modal that I render into the indexview. It has a form in it.

I also have this in my Videos controller:

def index
  @video = Video.new
  @videos = Video.paginate(:page => params[:page], :per_page => 20)
end

Why am I getting this error, and how can I fix it?

UPDATE:

Here’s my edit action in the Users controller:

def edit
  @user = current_user
end

Here’s the _modal partial:

<div id="boxes">
<div id="dialog" class="window">
<%= form_for(@video) do |f| %>
  <% if @video.errors.any? %>
    <div id="errorExplanation">
      <h2><%= pluralize(@video.errors.count, "error") %> prohibited this video from being saved:</h2>

      <ul>
      <% @video.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>
  <div class="field">
    <%= f.label :video_url %><br />
    <%= f.text_field :video_url %>
  </div>
  <div class="field">
    <%= f.label :title, 'Song Title' %><br />
    <%= f.text_field :title %>
  </div>
  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>
<%= link_to 'Cancel', '#', :class => 'close' %>
   </div>
   <div id="mask"></div>
</div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T18:49:49+00:00Added an answer on May 20, 2026 at 6:49 pm

    I believe you are basically having the same problem as last time.

    Since you are effectively rendering the edit action—whether it is in a modal or not—you need @video defined again.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got this flash application where you can click a link while watching a
I have this piece of code: $(#faq).click(function () { var url = $.get(faq, {
This is what i'm trying to achieve: Home (Table View) > (Click on row)
What is the difference between this: this.btnOk.Click += new System.EventHandler(this.btnOK_Click); and this? this.btnOk.Click +=
To create a new event handler on a control you can do this c.Click
$('input[type=checkbox]').unbind().click(function(e){ $(this).attr('checked', true) return false; }); I NEED to return false because I have
This question doesn't relate only to MouseEvent.CLICK event type but to all event types
I've got this code in a pair of button click event handlers on a
I have this jQuery which works fine $(li[id^='shop_id']).click( function () { alert(I clicked on
Consider this sample code: <div class=containter id=ControlGroupDiv> <input onbeforeupdate=alert('bingo 0'); return false; onclick=alert('click 0');return

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.