Questions tagged as 'ruby-on-rails'

1
answer

Why this form of using case does not work?

I have the following code: def label_file_type(type) label = case type.to_s when ['.jpg', '.jpeg', '.png'].include?(type) then content_tag(:span, 'Imagem', class: ['label', 'picture']) when ['.mp3'].include?(type) then...
asked by 20.04.2015 / 17:14
1
answer

Composite index - M: N in Ruby on Rails

I need to add a double index to the N to N ratio of the courses_internships table. it would look something like this: add_index[:course_id, :internship_id] . However, when I created the link table, the index was separated by the...
asked by 20.05.2015 / 18:14
2
answers

Require files no seeds.rb

I need to organize my seeds.rb file, so I created a namespace where I will add my classes ex: module Seeds class Apple def self.run puts 'teste' end end end Seeds::Apple.run This works perfectly, but I need to separate my class...
asked by 08.04.2015 / 18:43
1
answer

Launch Ruby application at boot

Hello, I have OpenProject, a Ruby on Rails application, I want it to start at the boot of the system, I put the script to start Upstart, but when I start the system, I see this error in my log:    / usr / bin / env: ruby: File or directory not...
asked by 02.06.2015 / 14:45
1
answer

Devise - Confirmation email and Forget password? [email does not send]

Problem does not send Confirmation Email and Password Change Problem After requesting the submission of forget password? it will load until giving time out . Thecreationofthetokenforpasswordexchangeisgeneratedcorrectly,acce...
asked by 25.03.2015 / 18:40
1
answer

Error sending email with Mandrill

Contact.rb template: class Contact include ActiveModel::Validations include ActiveModel::Conversion extend ActiveModel::Naming attr_accessor :name, :email, :message, :subject validates_presence_of :name, :subject, :email, :message...
asked by 17.03.2015 / 17:39
1
answer

How does application integration work on social networks?

It has become increasingly common to integrate applications of various types into social networks, such as Facebook, Twitter and even Github. I wanted to understand how this integration works. Gitter for example allows chat interaction in Github...
asked by 11.05.2015 / 16:39
1
answer

Reset Password with Rails

I'm working on a project and I need to do a password reset system. I'm not using gem and I do not want to use it. I found that the can_change filter runs and I'm redirected to the user page, which does not make sense to me, since the can_chan...
asked by 03.02.2015 / 21:01
1
answer

Remove elements out of standard deviation

I have the following array [123, 350, 3456, 98] and I need to remove items out of standard deviation, such as 3456 . I already have the standard deviation calculation as below: class Array def average return 0 unless self.size &g...
asked by 14.04.2015 / 16:25
1
answer

'Web application could not be started', Why?

I'm passing my project to the server. I'm using nginx. And everything is already installed, because when I go to my home address shows me: Welcome to nginx! If you see this page, the nginx web server is successfully installed and working. Fur...
asked by 13.04.2015 / 19:48