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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:00:57+00:00 2026-05-26T16:00:57+00:00

I am getting started with the paperclip plugin, but I can’t seem to get

  • 0

I am getting started with the paperclip plugin, but I can’t seem to get an image to show up in development. I added the following to my config/environments/development.rb file:

Paperclip.options[:command_path] = "/usr/local/bin/"

I installed imagemagick and ghostscript through the homebrew package manager. I then added the paperclip gem to my gemfile and ran bundle install. I then ran

rails g paperclip carrier_data asset
rake db:migrate

I then went to my carrier data model and added

has_attached_file :asset

After that I altered the form partial to add the resulting code so I could upload images, I am using the simple form gem and this is the following code that I have entered.

<%= simple_form_for [:carrier_datum, @carrier_datum], :url => carrier_datum_path, :html => { :multipart => true} do |f| %>
<div>   
  <%= f.input :asset, :as => :file, :label => "Upload File" %>
</div>

Finally I went to the show page and added the following code so I could view the image:

<%= image_tag @carrier_datum.asset.url %>

When I try to create a new carrier datum record I get this message:

No route matches {:action=>"show", :controller=>"carrier_data"}

The logs look like the following:

ActionView::Template::Error (No route matches {:action=>"show", :controller=>"carrier_data"}):
1: <%= simple_form_for [:carrier_datum, @carrier_datum], :url => carrier_datum_path, :html => { :multipart => true} do |f| %>
2:   <% if @carrier_datum.errors.any? %>
3:     <div id="error_explanation">
4:       <h2><%= pluralize(@carrier_datum.errors.count, "error") %> prohibited this carrier_datum from being saved:</h2>
app/views/carrier_data/_form.html.erb:1:in    `_app_views_carrier_data__form_html_erb__2372678434167691626_2513245300'
app/views/carrier_data/new.html.erb:3:in `_app_views_carrier_data_new_html_erb___55769200685419080_2513267980'
app/controllers/carrier_data_controller.rb:30:in `new'

I am running rails 3.1, with postgresql as my database if that helps at all.

Here is the output of rake routes

carrier_data GET    /carrier_data(.:format)           {:action=>"index", :controller=>"carrier_data"}
                     POST   /carrier_data(.:format)           {:action=>"create", :controller=>"carrier_data"}
   new_carrier_datum GET    /carrier_data/new(.:format)       {:action=>"new", :controller=>"carrier_data"}
  edit_carrier_datum GET    /carrier_data/:id/edit(.:format)  {:action=>"edit", :controller=>"carrier_data"}
       carrier_datum GET    /carrier_data/:id(.:format)       {:action=>"show", :controller=>"carrier_data"}
                     PUT    /carrier_data/:id(.:format)       {:action=>"update", :controller=>"carrier_data"}
                     DELETE /carrier_data/:id(.:format)       {:action=>"destroy", :controller=>"carrier_data"}
               pages GET    /pages(.:format) 

If I remove the simple form call and use regular form partial notation like this:

<%= form_for(@carrier_datum, :html => { :multipart => true}) do |f| %>
<div>   
    <%= f.label :asset, "Upload File:"%>
    <%= f.file_field :asset %>
</div>

I still get the broken image issue, and my logs say that the image is missing.

  • 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-26T16:00:57+00:00Added an answer on May 26, 2026 at 4:00 pm

    I ended up switching to carrierwave, and I must say it it a much better gem for file uploads. If you are working on rails 3.1 it is a better file upload solution.

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

Sidebar

Related Questions

Just getting started with MSpec and I can't seem to quite get my first
I'm getting started with Paperclip and can't figure out something: why isn't this form
Getting started with NHibernate How can I generate identity fields in nHibernate using Hilo
Getting started with Django 1.3 here. Loving the system so far, but struggling on
I'm just getting started with a project and wondered if someone can let me
Just getting started with C++, done a bit of C but one thing I
Hi I'm just getting started on the v4 CTP so I can see me
I am just getting started with Silverlight and have recently added a Silverlight project
Getting started on writing my first build script. I dont get the whole dependency
Im getting started with android development and i have a few questions about supporting

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.