PROBLEM WITH PAPERCLIP

hello, i am trying to upload a image file …using paperclip in rails 3 i did as follows

  1. In gemfile => included gem paperclip

2.In config/environments /development.rb => Paperclip.options[:command_path] = “/usr/bin/” (convert path) 3.created a controller picusers and defined => def create @picuser = Picuser.create(params[:picuser]) end

4.created a model picuser with =>has_attached_file :avatar, :styles => {:medium => “300300>", :thumb => "100100>” } created a migration file with following columns => class AddAvatarColumnsToPicusers < ActiveRecord::Migration def self.up add_column :picusers, :avatar_file_name, :string add_column :picusers, :avatar_content_type, :string add_column :picusers, :avatar_file_size, :integer
add_column :picusers, :avatar_updated_at, :datetime end def self.down remove_column :picusers, :avatar_file_name remove_column :picusers, :avatar_content_type remove_column :picusers, :avatar_file_size remove_column :picusers, :avatar_updated_at end end 5. created a view with picuser => show.html.erb <%= image_tag @picuser.avatar.url %> <%= image_tag @picuser.avatar.url(:medium) %> <%= image_tag @picuser.avatar.url(:thumb) %> => edit.html.erb <% form_for :picuser, @picuser, :url => picuser_path, :html => { :multipart => true } do |form| %> <%= form.file_field :avatar %> <% end %> => new.html.erb <% form_for :picuser, @picuser, :url => picuser_path(current_picuser.id), :html => { :multipart => true } do |form| %> <%= form.file_field :avatar %> <% end %> GETTING ERROR AS NO ROUTE MATCHES :SHOW CONTROLLER:PICUSERS EVEN AFTER SETTING ROUTES.RB PLEASE COULDANYONE THERE HELP

try “rake routes” in your console and see if there is anything like: user {:action => ‘show’, :controller => ‘pictures’}

Here you don’t have any issue with paperclip it seems!! its some routing issue which is messing things up!

Hi, You declared method show in picusers controller. And check the routes by giving rake routes in your project path. One more thing, if u changed anything in routes file, don’t forget to restart the server.

Thanks, Manivannan.S