Questions tagged as 'ruby'

1
answer

When I save a form with nested_form_fields the console remains in BEGIN - Ruby on Rails

I need your help please. I can not create a new record with other nested records, because the console remains in BEGIN , that is, only the first query is output, which is the one that creates the main record, but never continues to insert...
asked by 22.08.2016 / 05:31
1
answer

Help with send_file Ruby on Rails

I fear the following problem. I try to show a list of files that are hosted on the server. The files are hosted in / home / drakmond / Practicas / Yipi / logsLoader and with extension .txt. The driver code is as follows: class Admin::LogsCo...
asked by 16.08.2016 / 02:05
2
answers

How to show the result of the show method in Ruby [closed]

I have a problem calling the show method, this should show the list of items in the shopping cart, but I get an empty string as a result. class ShoppingCart def initialize @items = {:apple => 10, :oranges => 5 , :grapes => 15,...
asked by 09.06.2016 / 18:41
0
answers

How can I show images in Post in rails in real time?

I'm using json.jbuilder json.array!(@posts) do |post| json.extract! post, :id, :body, :user_id json.image post.image.url json.url post_url(post, format: :json) end And I render with js $("#posts").prepend("<%= j render @post %>...
asked by 14.06.2016 / 23:10
2
answers

Hide f.select to users

I would like to duplicate _form.html to show different options to each person logged in, for example one person can see from f.select 4 options out of 20 that exist, another person can see 3 options out of 20. How could I create...
asked by 16.06.2016 / 00:54
1
answer

Create routes for authenticated users and not on rails 4

I would like to create two root routes, one for authenticated users and one for non-authenticated users; for this I use devise , I tried the following code but it gives me an error. Error    Invalid route name, already in use: 'r...
asked by 25.09.2016 / 08:00
2
answers

Styles ComboBox Bootstrap

I have problems with a comboBox , generated with ruby . I can not see why you are not taking the Bootstrap styles comboBox Brand . The form is _form.html.erb <%= form_with(model: cotizacion, scope: :cotizacion, local:true, class...
asked by 03.08.2017 / 00:09
4
answers

Gem vs rails in ruby on rails?

Excuse me, I'm a bit of a rookie on ruby but when I run the ruby on rails server, the rails command does not work. I use the command '' gem '' for the server Note I'm in windows my question is is not it a problem for a real project? * Excu...
asked by 12.11.2016 / 05:58
2
answers

Ruby on Rails, problem with database when displaying

I want to show the data of my rails database on the page. I have managed to show the entire database, all the information. But what I want is, that only one column appears, in this case the name information. Let me make a list of the names I...
asked by 09.05.2017 / 12:56
1
answer

Error installing gem "mongo"

I have a problem installing the mongodb gem, can someone tell me the problem? $ gem install mongo -v 2.2.4 ERROR: Error installing mongo: ERROR: Failed to build gem native extension. current directory: C:/Ruby25-x64/lib/ruby/gems...
asked by 08.03.2018 / 02:56