Questions tagged as 'ruby-on-rails'

1
answer

Add all solver groups in the Select Box

I have a Select Box with some solver groups and a button to add them to the bank. When I click the button, I add the solver group to the bank. But this is done one at a time. I would like to do this all at once. Here is my code below: <%...
asked by 24.12.2015 / 12:48
1
answer

Error while running a Rake Task

I need to perform some custom tasks, however, whenever I try, I get the following message: Application has been already initialized. I searched in various places, including the OS in English, but to no avail. It does not seem to have a de...
asked by 07.12.2015 / 16:34
1
answer

Many to Many rails form

I would like to know how to do a form many to many in rails. Here are my models: class Course < ActiveRecord::Base has_and_belongs_to_many :notices, dependent: :destroy has_and_belongs_to_many :internships, dependent: :destroy en...
asked by 30.08.2015 / 04:58
1
answer

Error uploading rails server

I have Fedora installed on my machine with PostgreSQL 9.4 . However, whenever I try to upload the Rails server, this error appears:    FATAL: peer authentication failed for user "api" However, when running systemctl status postgresql-...
asked by 22.08.2015 / 02:54
1
answer

Routing Error in Rails - uninitialized constant

Well, I created an application in rails and generated some models, controllers, etc. As follows: rails g scaffold nivelIntermediario/Historia descricao:string My route file looks like this: namespace :nivel_intermediario do resources :...
asked by 19.09.2015 / 02:28
0
answers

Rails does not install on CentOS

I'm running a VPS with CentOS running, and I can not seem to get out of this error: [athos@athoscastro bin]$ gem install rails Fetching: nokogiri-1.6.6.2.gem (100%) Building native extensions. This could take a while... ERROR: Error installi...
asked by 17.08.2015 / 03:03
1
answer

Authorization problem with pundit

In the controller lodger I put this function authorize , passing user that is logging into the system, within the #destroy method. What I need is for only the user admin to perform the deletion operation. def destroy...
asked by 03.08.2015 / 19:31
1
answer

Page loading Ajax + Jquery + Ruby on Rails

Oops, good afternoon guys, I'm a little new to rails and to with a little difficulty. I have a login form (sessions / new) and a registration form (users / new), in each of these forms, I have a link in which when clicked redirects the user to t...
asked by 04.08.2015 / 20:10
1
answer

Deploy Ruby on Rails with Capistrano

When running deploy I get the following error: Rack app error: #<RuntimeError: Missing 'secret_token' and 'secret_key_bas' for 'production' environment, set these values in 'config/secrets.yml I have already made the necessary set...
asked by 04.08.2015 / 16:56
2
answers

Advanced Query in Ruby On Rails (ActiveRecord)

I need to do a query for a report something like this: Produto.include(:clientes).where('count(produto.id) < cliente.quantidade') In sql it would look something like this: SELECT C.NOME, C.QUANTIDADE, COUNT(P.ID) FROM PRODUTOS...
asked by 29.06.2015 / 16:53