Questions tagged as 'ruby-on-rails'

2
answers

Create several related database records in the same view

I have two models in Rails, one is Worker and the other Assistance. A worker can have many assistances and each assistance is of a single worker. I need to create a view where all the workers appear in each one and next to each worker I see t...
asked by 04.01.2017 / 02:52
1
answer

redirect using a checkbox

I need to place a checkbox in my rails form that when it is checked and the user saves the form, it will be redirected to another page, but only when said checkbox is checked and this is a field that will not be in the base of data. How could I...
asked by 26.10.2016 / 05:59
1
answer

Rails save data of another model in a form

I have a User model created with devise with a relationship towards Setting class User < ActiveRecord::Base has_one :setting end class Setting < ActiveRecord::Base belongs_to :user end The User model has attributes: first...
asked by 01.06.2016 / 18:22
1
answer

Relationship between two tables with different id

I'm trying to make a relationship between the users table and the companies table, the database was previously created outside of rails, so the primary key of companies is "company" and the user "user", the relationship : a company has many user...
asked by 11.07.2016 / 18:35
0
answers

Calculate stocks by the number of items in their content Rails

a small query, while I make an inventory system for a client, a little logic problem arises when calculating stocks, although they are perfectly calculated as Inputs - Outputs, obtaining the stock of all items, without However, there are some pr...
asked by 12.07.2018 / 05:08
2
answers

How to use "ajax" with the "scaffold" of Ruby on Rails

Hi, I'm using (REACT and Ruby on Rails) together and ajax and scaffold together to make a POST , PUT , DESTROY , GET but at the time of doing the POST simply does not do anything, this is my code:...
asked by 14.05.2017 / 22:24
6
answers

Localhost in rails does not show CSS

I already link the css with the html but even so the page does not show the css settings, only the html ... I am working with rails.     
asked by 07.03.2017 / 20:08
1
answer

SIGUSR2 not implemented, signal based restart unavailable!

I am starting to learn a couple of things for web design, and there is something that does not work. I program in Windows and when I want to start the command rails s I throw this: **PS C:\Users\Asus\hello_WWW> rails s => Booting...
asked by 16.03.2017 / 15:25
1
answer

Delete records with ajax rails

I'm trying to delete records from my table, but even if you delete them, you do not update the list with ajax: enterprises_controller.rb def destroy @enterprise_tag.destroy respond_to do |format| if @enterprise_tag.destroy...
asked by 31.12.2016 / 19:31
1
answer

Problems with Group_by Rails

It happens that I use a group_by to divide the posts according to their year by means of a scope, and it works great I print the posts in groups per year, the problem is that when migrating to Rails5, always I divided them but I printed the ot...
asked by 24.11.2016 / 04:52