Questions tagged as 'ruby-on-rails'

1
answer

error when creating record ActiveRecord :: AssociationTypeMismatch in RatingsController # create

When trying to insert a record I get an error in the controller    Rating (# 47310743451000) expected, got String (# 47310719254620) This is the instruction: sql= Rating.create(:user_id => params[:rating][:user_id],...
asked by 24.04.2017 / 22:31
2
answers

Show new registration form devise even when logged in

I'm working with the Gema devise for user authentication in my application, but I have the following doubt, I can create users without breaking into the system, but how do I manage to register them when logged in? (Show me the form) and do not s...
asked by 15.03.2017 / 08:08
1
answer

Compare "id" of two related objects

Maybe the question is simple for you. I use the Bidon and Buy models, which are related, when I show the detail of the drum suppose with ID: 1, in the I am showing the last purchases that are made with that drum, what I can not get is tha...
asked by 26.02.2017 / 08:33
1
answer

Problems with validations using Ajax in Rails

I'm trying to show the validation errors in Rails using ajax in a modal, but I can not show them, I hope they can help me, I will greatly appreciate, I share my code: _form.html.erb <%= form_for @enterprise, remote: true, html: { multi...
asked by 29.12.2016 / 20:46
3
answers

Rails uninstalls itself

I am trying to learn Ruby on Rails and it has cost me enough to start with configuration issues. Yesterday I was following a tutorial, so I installed Ruby and then rails with gem install rails , and everything worked fine. But today...
asked by 16.12.2016 / 14:40
2
answers

problem with the ruby on rails server

hello friends I have ruby and ruby on rails installed and it works correctly but the server does not work with the "rails server" command but with "gem server" error message: root@sommer0123-AO532h:/home/sommer0123/Escritorio/blogruby/...
asked by 15.02.2017 / 03:26
1
answer

duplicate records of a query

I'm making a query to find all those products that are not related to a table called Stock where the field Ruta within the table Stock is different from id I'm going through the url, that means searching for all those...
asked by 18.11.2016 / 16:27
1
answer

I can not create a project in rails

I installed rails from link After installing it, I wanted to create a project with the command C:\Sites>rails new blog But when executing the command, the answer is as follows:    The route can not be found. Can you give me a...
asked by 17.10.2016 / 15:55
3
answers

Ruby on Rails login view

I'm new to rails and I have a problem with the login view, I tried to put a menu at the top of the page with the CSS attributes but when I run the server rails the menu appears in the middle of the page and Do not go up as I want. I hope it is n...
asked by 22.11.2016 / 20:36
1
answer

Create data of a form when saving those of another form

I need that when sending the data of a form, automatically send the data of another form creating a record in another table in the database, it is worth noting that both records do not have a direct relationship. these would be the two forms...
asked by 05.11.2016 / 05:48