开发者

Rails: carrierwave uninitialized constant error

I have Rails 3

Carrierwave 0.5.4

//app/uploaders/fasta_uploader.rb

class FastaUploader < CarrierWave::Uploader::Base
  storage :file
  开发者_开发百科def store_dir
      'public/data/01_fasta'
  end
end

//migration

class AddFileUpToCvits < ActiveRecord::Migration
  def self.up
    add_column :cvits, :fasta, :string
  end

  def self.down
    remove_column :cvits, :fasta
  end
end

//app/models/cvit.rb

class Cvit < ActiveRecord::Base
    attr_accessible :fasta
    mount_uploader :fasta, FastaUploader
end

//form

<%= form_for(@cvit, :html => {:multipart => true, :onsubmit => "return ray.ajax()" }) do |f| %>
  ...
  ...
  <%= f.file_field :fasta %><br></br>
  <div class="actions">
    <%= f.submit "Submit"%>
  </div>
<% end %>

I get this error: uninitialized constant Cvit::FastaUploader

Any suggestions???


A simple reset of the server fixed the problem -_- You live and you learn.


Restarting the server doesn't work for me. I restarted my mac and it fixed the issue.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜