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

  • SEARCH
  • Home
  • 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

Please visit this link Click on first Image. Now is showing the Modal page
for the moment the script does like this: click on the link edit the
I have an Index view. On this view is a link, and it is
Click on this link , you will be redirected to a shopping site. On
Tried this: $('.link').click(function(e) { $.getScript('http://www.google.com/uds/api?file=uds.js&amp;v=1.0', function() { $('body').append('<p>GOOGLE API (UDS) is loaded</p>'); }); return
I'm sending a page event: page.sendEvent('click', 650, 430); This clicks a link that dynamically
Is this possible if I click on an anchor link to simulate as if
I have this code in the end of link button click: Response.ContentType = application/zip;
This code works perfectly except when you click on a link, The page is
I asked a precursor to this question here: Click link in DIV and show

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.