Questions tagged as 'ruby-on-rails'

1
answer

Printing in Ruby on Rails

I have the following problem, I need to print the data that is generated by my Ruby on Rails application, but this impression must be made directly on the USB / Serial port of the client. The printer used will be a Zebra . I've tried usin...
asked by 12.08.2016 / 16:17
0
answers

Search in json nested rails files

I have some files that are: services, organs, units. The organs have services and have units. I, in the jsons I have, can return to the part where, for example: localhost / api / organs / .json. That there it returns the services and the units t...
asked by 12.09.2016 / 20:39
1
answer

Relationship Through Many-To-Many ActiveRecord

I have the following configuration in rails: Company has_many :company_products has_many :products, :through => :company_products Product has_many :company_products has_many :companies, :through => :company_products P...
asked by 13.09.2016 / 22:00
3
answers

Display fields from a hash in the view

I have a result of a variable that receives the output of an sql from postgres. I need to iterate in a view and I do not know how to display the given fields. In products_controller I have: def show sql = "SELECT products.cod as cod_pr...
asked by 06.08.2016 / 21:48
1
answer

How to implement login with attribute coming from another table with Devise in Rails 4?

I currently have a User Template that has a has_one relationship with Customer . In the customer tables I have the CPF field that the user informs when to register. I need to implement a login where the user inputs the e-mail...
asked by 08.09.2016 / 23:18
0
answers

Create new user in the database via Rails C

Help me where the error is occurring, because I am not able to identify because the field is not being recognized.    rails c u = User.new(email:'[email protected]', registration:192536, password:'changeme', password_confirmation:'changeme') Look...
asked by 06.09.2016 / 21:01
1
answer

Different objects of type Model mapped from a single table

Is it possible to map different Model objects with ActiveRecord in a Ruby on Rails project from a single database table? Assuming I have in the database a table named clients that will be populated by clients of the physical type and le...
asked by 16.07.2016 / 03:31
0
answers

bundler rails with user problem

Hello, I have a drop in digitalocean, and I installed ruby on rails through the main panel, I can not use the bundler through upstart or cron, it says that the user does not have the bundler, but when access via ssh do everything normally. ex: b...
asked by 03.08.2016 / 00:09
1
answer

Foreign Key in Ruby on Rails 5

Good morning, I'm a few days with a problem using Rails5, I can not insert foreign key. Models: class Sushi < ApplicationRecord belongs_to :tipo_sushi end class TipoSushi < ApplicationRecord has_many :sushi end Migration:...
asked by 11.07.2016 / 21:09
0
answers

NFS-e signature problem - Verified consignment after signature

I am developing the issue of NFS-e for the city of Gaspar-SC via web service, in which it uses Thema company to process the notes. I'm having trouble subscribing to NFS-e where I'm returning the error: E515 - Error signing signature. - Deli...
asked by 03.08.2016 / 21:59