Questions tagged as 'ruby-on-rails'

2
answers

Add new field to the database with Rails

I inserted a new column in my table contents and also includes the field in the form with the same column name in the (client_id) creation table, but this data is not entered when I create a new record. I already added symbol...
asked by 28.09.2016 / 18:41
1
answer

HEROKU connect to mysql database

I'm doing reverse engineering on a system, and I want to use the same database as the old system. But I am not able to connect the system bank in production with this database. And for being in MYSQL I'm using the mysql2 gem, as follows: herok...
asked by 03.10.2016 / 19:03
2
answers

What is the best way to create a model that has a field that is an integer enum?

What is the best way to create a model that has a field that is an integer enum? ex: rails g model status (I do not know how to report it is an enum nor the data type)     
asked by 27.03.2016 / 16:03
1
answer

Redirect to another action from another controller in Rails

I am developing a simple action, when saving a register if there is value in a certain field the system must redirect to a create of another model / controller. I'm having trouble making this happen. if @reproduction.update(reproduction_par...
asked by 05.03.2017 / 22:16
1
answer

Autocomplete of jQuery UI only works once

I'm working on a feature of a Rails application where we use a gem called Best in Place , which provides the possibility of inline editing attributes of a model. But there arose the need to use autocomplete of jQuery UI when the user is editing...
asked by 04.12.2015 / 13:03
2
answers

Enable CORS in api rails

Using this GEM to enable CORS my application. The code I have in my config/application.rb is as follows: config.middleware.insert_before 0, 'Rack::Cors' do allow do origins 'http://localhost:8080' resource '*',...
asked by 02.06.2015 / 15:44
1
answer

How to execute JavaScript function on current page through Application Controller?

I'm doing a browser validation (IE < 10) through the Application Controller with gem "browser" . I need any JavaScript page with a message saying that browser is not recommended for any page of the application that is accessed. A...
asked by 10.06.2015 / 15:31
1
answer

How to make an ajax request that returns a text in html?

Assuming the link making the request is: <%= link_to 'New Classroom', new_classroom_path,class: :remote_link, remote: true %> And that the return processing of it is: $('.remote_link').bind('ajax:success',function(e, data, status, x...
asked by 05.05.2015 / 01:19
1
answer

Erase a flash [: success] a few seconds after being shown to the user?

I have a registration form using Rails, where after the user completes the registration, he is redirected to the login page along with a flash[:success] that shows a welcome message. My question is if I had some form in Rails itself to...
asked by 09.08.2015 / 02:22
1
answer

Problem creating Rails application

When I create an application, at the time of doing a scaffold (following tutorials) I get the following error: C:\Users\User\Usuarios>rails generate scaffold Usuario nome:string idade:integer C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/sqlite3-1...
asked by 28.04.2015 / 19:47