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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:47:04+00:00 2026-06-09T02:47:04+00:00

I have installed paperclip and imagemagick,and implemented the code to my model and view

  • 0

I have installed paperclip and imagemagick,and implemented the code to my model and view file.
I have a database column named ‘picture’ and it is empty no matter if i uploaded a picture or not. the picture acctually exists in the/public/system/decks/pictures/000/000/019/medium folder. i can see all of the uploaded pictures there, but i can’t show them cause the database is empty.

My model:

class Deck < ActiveRecord::Base
  attr_accessible :picture

  has_attached_file :picture, :styles => { :medium => "300x300>", :thumb => "100x100>" }
  attr_accessor :picture_file_name
  attr_accessor :picture_content_type
  attr_accessor :picture_file_size
  attr_accessor :picture_updated_at

My view:

<%= form_for @deck,:url => decks_path, :html => { :multipart => true } do |f| %>
  <%= f.file_field :slika %>

My migration:

class AddAttachmentPictureToDecks < ActiveRecord::Migration
  def change
    add_column :decks, :picture, :attachment
  end
end

So i get the picture in that folder that i have mentioned before but the picture column in my decks table is empty. I can’t get the picture with <%= image_tag @deck.picture.url(:medium) %>, cause my @deck.picture.url holds a /pictures/original/missing.png, my @deck.picture.path and my @deck.picture.picture_file_name also shows nothing.

Thank you.

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

    in the end it looks like i mixed the old syntax and the new one and i couldn’t get the fields right in the database. and it looks like the attr_accessors are unneccessary

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

Sidebar

Related Questions

<%= image_tag message.photo.url(:small) %> I have paperclip installed and the above code displays an
I have installed RockMongo http://code.google.com/p/rock-php/ to manage my mongoDB database. This is installed in
I'm following the railscast for PaperClip and have ImageMagick installed. I followed his video
I am having problems uploading images to Amazon S3. I have installed the paperclip
I have installed the Paperclip plugin to attempt to upload an avatar for my
I have just installed paperclip into my ruby on rails blog application. Everything is
I have the following gems defined in my environment.rb file: config.gem authlogic config.gem paperclip
We have installed OpenDataKit (ODK) Aggregate and we are using a MySQL Database. I
I have installed C++SDK that have Qt but when I try compiling a code
I'm getting the error message from some validation code I have in my model.

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.