Questions tagged as 'ruby-on-rails'

1
answer

pull data from a third table in a simple relation

Hi! I have 3 tables. animal studies, species and provenances, where: estudoanimais belongs_to especie estudoanimais has_many_procedencias especie has_many estudoanimais procedencia belongs_to estudoanimal At the moment I create a provenance...
asked by 06.05.2016 / 15:58
0
answers

problems with conversion haml to html / erb

Hello. I have the following snippet in haml: %a.btn.btn-small.notes_campaign{:role => "button", :data => {:campaign_group_id => campaign_group.id}} %i.icon-tasks Notes And you'd get to pass it on to erb. My problem is in thi...
asked by 26.03.2016 / 05:40
1
answer

require command does not work in gem for ruby

I installed Ruby , RailsInstaller and RubyDevKit on the C partition (eg c: \ Ruby23-x64). Execution in cmd    ruby -v Theversionofrubyinstalledwithnoproblemsappears.Execute  geminstallpipedrive-rubyandalsoinstallswithoutproblems,...
asked by 13.05.2016 / 05:56
1
answer

Error setting up Ruby on Rails environment

Good afternoon, folks. I'm learning Ruby on Rails in college and to practice at home I'm trying to install and configure the environment on my pc, but with no success. I installed NetBeans and MySQL Server and when I create a new Ruby on Rails p...
asked by 18.03.2016 / 19:26
0
answers

Change Request Headers for WS protocol

I have an Ionic app that uses a Ruby on Rails API. To authenticate, I'm using the Devise and tiddle gems where I step through the AngularJs interceptor X-USER-EMAIL > and X-USER-TOKEN in Request Header There is a part of the appl...
asked by 10.02.2016 / 17:43
1
answer

Create just too much relationship for many in Ruby

I have a very close relationship with the entities yell and category: model yell.rb class Yell < ActiveRecord::Base belongs_to :user, inverse_of: :yells has_and_belongs_to_many :categories def as_json(options={}) super(:only =...
asked by 27.01.2016 / 13:27
2
answers

How to do rewrite correctly in Nginx?

I'm having trouble configuring Nginx as a reverse proxy in an application. It is a Rails application, which runs on unicorn. In this case, I have the link domain. Instead of creating a subdomain, I'd like link to be the root url and direc...
asked by 24.02.2016 / 22:52
2
answers

Help with relationships #rails

I have 3 tables    area name       area_shared area_id request_id       request area_shared_id area_id I'd like to display my table in this way <% = @ request.area_shared.area_name% > But I think my relationships are...
asked by 08.01.2016 / 13:25
1
answer

Admin View Ruby on Rails

Next I created a site using Ruby on Rails and the Devise and Pundit gems. Users have a role that can be Analyst, Developer or Administrator. I am using a View to list all users registered to the admin. This is my Controller :...
asked by 13.11.2015 / 13:28
1
answer

How to test custom Rails validator

Hello, I have the following custom validator class StatusMappingValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) return nil if can_move_to?(record.class::STATUS_MAP, record.status, value) record.e...
asked by 05.07.2016 / 14:45