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 7806309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:29:35+00:00 2026-06-02T02:29:35+00:00

I am working on a rails application and I have a Dashboard::user(dashboard/user) controller and

  • 0

I am working on a rails application and I have a Dashboard::user(dashboard/user) controller and I would like for users to update their blog post through the backend of the site. That works fine but when I am trying to get a list of the latest blog post a user has created I get an error.

dashboard/users_controller

def content
  @blog = Blog.new
  render ('content')
end

dashboard/blogs/_blog_list.html.erb

<%= div_for(:dashboard ,blog) do %>
  <%= link_to image_tag(blog.preview.url(:thumb)), dashboard_blog_path(blog) %>
  <h1><%= link_to (blog.title),dashboard_blog_path(blog) %></h1>
   <p><%= truncate blog.excerpt, length: 160 %></p>
  <%= blog.published_at %>
  <%= blog.site_id %>
<% end %>

controller

def content
  @site = Site.find_by_subdomain!(request.subdomain)
  @blogs = @site.blogs.all
  @blog = Blog.new

  render ('content')
end

content.html.erb

<%= render :partial => 'dashboard/blogs/blog_list', :locals => {:blogs => @blog} %>

Any reason why this is not working?

  • 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-06-02T02:29:36+00:00Added an answer on June 2, 2026 at 2:29 am

    My best guess is that the local variable blog was never set. @blog will be available in the partial, but blog will only be available if it is explicitly set, for example if the partial is rendered via

    render :partial => "blogs/blog_list", :locals => {:blog => @blog}
    

    See http://apidock.com/rails/ActionView/Partials for more details about partials.

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

Sidebar

Related Questions

I'm working on a Rails application that's kind of like a blog. Users create
I'm working on a small Rails application in which I'd like users to be
I have a fairly simple Rails application that allows users to manage their clients
I'm working on a Rails application where I have users that can add each
I am working on a rails application (I have some experience with rails). But,
I'm working on a Rails application where I have some a set of two
I am thinking of working on a Rails application that uses PostgreSQL. I have
Background Currently, I am working on a Rails application. I have different products that
I have set up the Nginx +unicorn for my rails application, it is working
I have a working Rails application on version 2.3.5 - I am using many

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.