Questions tagged as 'ruby-on-rails'

1
answer

Nested resources with devise problem

The client has many quotes and I am trying to delete or edit the quotes according to the client that is connected, but I get this error    Could not find Quote with 'id' = 2 [WHERE "quotes". "client_id" = $ 1] the id that is rescued belon...
asked by 27.02.2017 / 17:33
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
1
answer

specify another id for a custom one

I'm using a previously created database and the id of the table is called "idempresa" , how could you specify rails that the id will save it in that field?     
asked by 29.06.2016 / 19:44
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
0
answers

Add modal to Rails and devise [closed]

Greetings people, how can I add a modal to the login form part in rails 4? I have devise installed and I need a modal to be displayed when the user clicks on the login option of the site     
asked by 05.05.2016 / 17:42
1
answer

Put my devise login form in another view

I'm trying to place my rails access form in my main view, I'm following this tutorial Upload the devise login form from another view but give me a little error with omniauth I do not know why, I guess you are not referring to it, this is the e...
asked by 22.04.2016 / 19:01
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