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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T03:47:09+00:00 2026-06-07T03:47:09+00:00

I am using paperclip and rails. I followed this tutorial: Multiple File Uploads with

  • 0

I am using paperclip and rails. I followed this tutorial:
Multiple File Uploads with Paperclip & Rails 3 (Screencast)

I have a gallery model that has many galleryphotos.

Instead of linking to the original image in my view, I created a show method in photoimage, but I get the the following error:

undefined method `galleryphoto_path' for #<#<Class:0x007f40a0000c20>:0x00000005385d60>

Here is my code:

<% for asset in gallery.galleryphotos %>
  <%= link_to image_tag(asset.photo.url(:thumb)), url_for(asset) %>
<% end %>

Here is my galleryphoto controller:

class GalleryphotosController < ApplicationController
  load_and_authorize_resource

  def show
    @gallery = Gallery.find(params[:gallery_id])
    @galleyphoto = @gallery.galleyphotos.find(params[:id])


    respond_to do |format|
      format.html # show.html.erb
      format.json { render json: @gallery }
    end
  end
 end

Here are my routes for these:

  resources :galleries do
    resources :galleryphotos
  end

Any ideas how to fix this?

  • 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-07T03:47:10+00:00Added an answer on June 7, 2026 at 3:47 am

    The url_for helper will not find a route for the Galleryphoto model because it depends on the Gallery model. It is declared in the routes as a nested resource, so a Galleryphoto does not exist without a Gallery in the url.

    To fix this do any of the following:

    <%= link_to image_tag(asset.photo.url(:thumb)), url_for(gallery, asset) %>
    

    or

    <%= link_to image_tag(asset.photo.url(:thumb)), gallery_galleryphoto_path(gallery, asset) %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Rails 3.1 with Paperclip and trying to implement Uploadify for multiple file
I am using Paperclip to upload multiple item images. I followed some of this
So I've followed the instructions here: http://doganberktas.com/2010/09/14/amazon-s3-and-paperclip-rails-3/ In my profile model I have: attr_accessor
I have a photo rails app using paperclip. My model called photo and the
I'm very new to Rails. Basically, I have a Sound model that uploads an
Currently I'm using Paperclip to handle my avatar uploads and usage in Rails 3.
I have a RESTful resource in my Rails app called Photo. I'm using Paperclip
I need to allow multiple downloading of small documents in Rails, preferably using Paperclip
Hi i want to upload mulitiple file using rails 3 and paperclip please help
I'm using Paperclip and have a default_url option like this for one of my

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.