Les meilleurs développeurs Ruby on Rails freelances sont sur Codeur.com
Fermé · 30 à 300 € · 470 vues
I have a Question model which was an ActiveRecord one, but I migrated it on Elasticsearch with Tire gem. Until it was on ActiveRecord everything was working great. But not anymore.
What I want is to upload a remote file (ex. : [URL visible pour les membres Pro]) and store the file name in "path" field on elasticsearch.
Here is my Question model (which currently doesn't work):
class Question
include ActiveModel::MassAssignmentSecurity
include ActiveModel::Validations
extend CarrierWave::Mount
include Tire::Model::Callbacks
include Tire::Model::Persistence
# set fields for carrierwave uploader
mount_uploader :path, QuestionUploader
validates_presence_of :question
attr_accessible :path
attr_accessor :remote_path_url, :remove_path
property :difficulty
property :question
property :path
end
And then in my questions_controller:
class QuestionsController < ApplicationController
def create
[Email visible pour les membres Pro] = Question.new question: "How are you ?", difficulty: 3
[Email visible pour les membres Pro] = "[URL visible pour les membres Pro]"
[Email visible pour les membres Pro]>
render nothing: true
end
end
Elasticsearch record works, but no upload happens...
What I'm waiting for this job is the question.rb questions_controller.rb and question_uploader.rb files
Requirement : Use Tire gem in PERSISTENCE mode ! And Carrierwave with Fog gem and S3 endpoint (but for development you can use local upload).
It's not a hard work then it's low budget. If you're able to make it work in a perfectly clean way (no workaround allowed) then you're my man!
Budget indicatif : 30 à 300 €
Publication : 24 novembre 2013 à 17h21
Profils recherchés : Développeur Ruby on Rails freelance
Déposez une annonce en décrivant votre projet et recevez gratuitement des devis en quelques minutes