Questions tagged as 'rails4'

1
answer

Rails and Webmotors

Anyone with any experience with Rails integration with Webmotors APi? I'm using Gem SAVON to integrate the application with the site API and I'm getting the error:    Savon :: SOAPFault: (soap: Server) Server was unable to process request....
asked by 24.12.2015 / 15:22
1
answer

Defining a tree structure in ruby on rails

I'm developing a system in ruby on rails, and I'm stuck on one issue. My question is this: I need to create a tree, and then create my 'no' object and I would like it to have a 'no' parent and a 'no' child list. I tried the following approach:...
asked by 15.06.2017 / 19:56
1
answer

Multiple submits calling multiple methods in a single form

Hello! I have a form that contains two buttons, each button, when clicking, takes me to a different method inside the same controller. How do I do what needs to be done? Because I can not. form <%= form_tag (@portabilidade), method: :get...
asked by 16.05.2016 / 15:06
4
answers

Mask in Rails fields

I'm getting a theoretically simple thing, I'm looking for a date mask on my application.js : //= require maskedinput jQuery(function($){ $("‪#‎datadoacao‬").mask("99/99/9999"); }); In my partial form: <%= f.text_field :data_doaca...
asked by 27.07.2016 / 05:32
1
answer

Find random objects using conditions

I want to search for example 10 random people of the same party I did the following, but this is selecting people from all parties, what can be done? = D class Pessoa < ActiveRecord::Base class << self def filtra_pessoas(...
asked by 28.09.2016 / 07:17
1
answer

Rails - BD Relationship

I have a user table, where I have a required field cidade , and I have a contatos table (which is belongs_to: user ), but in the form it does not have the cidade field that is required for user . How do I p...
asked by 15.10.2018 / 17:33
1
answer

How do I get the value of a hash in rails?

I have some checkboxes inside a form in the view, that values are being sent to the controller by params for the index. Obs. I am sending the values of the checkboxes of the view index to itself, I need the values of the checkboxes in a varia...
asked by 12.07.2017 / 05:27
1
answer

Devise multiple login pages!

I'm using Devise to authenticate myself. But I have 3 profile types, and I created it through the command rails g devise MODEL my users (Admim, dev and manager), but Devise created a login page for each type of profile, I would like to un...
asked by 01.06.2017 / 13:18
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

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