Questions tagged as 'ruby-on-rails'

1
answer

One JavaScript per view in Ruby on Rails

I am trying not all JavaScripts to be used in all HTMLs. The first thing I did was eliminate the require_tree. Then I used this line in my view <%= javascript_include_tag "fiscal", "data-turbolinks-track" => false %> and I go...
asked by 27.12.2017 / 23:21
1
answer

Problem in reading file ruby on rails

Any idea why you give this error? No such file or directory @ dir_initialize - /lib/oc/ I have several txt files in that folder my code reads any .txt file and then I use it to analyze it. Dir.foreach('/lib/oc/') do |item| next...
asked by 07.12.2017 / 15:05
1
answer

What is the easiest way to generate a view that shows me the headings and the details ruby on rails

I would like to get the details of a header and I have them all related, I just need to show them in the same view, try to add it but it says undefined method cod_prod for nil:NilClass <p id="notice"><%= notice %></p>...
asked by 01.12.2017 / 15:49
1
answer

carrierwave when editing does not find the route

I'm using the gem Carrierwave to upload pdf ; is working correctly when creating, but the drawback is when editing, if I save it takes me to show and I get the following error:    No route matches [POST] "/ client / 5" (example)....
asked by 15.12.2017 / 00:30
1
answer

cycle foreach and next if a condition is met help in ruby on rails

Cycle foreach and next if a condition is met, I am analyzing a line in a txt and I want to verify if the next line complies with a pattern to do one thing and if not to do something else. Example: next if line.include?("UNSS...
asked by 14.12.2017 / 15:39
1
answer

Error rendering a partial of a controller from another controller

I am trying to render a table of records for a Orders controller in another controller called Dashboard . I've read a lot about doing it with: <%= render 'orders/index'%> And it throws the following error: The current code...
asked by 27.11.2017 / 18:46
1
answer

Read any extension .txt file inside a specific folder in ruby every 2 minutes

I want to read every 2 minutes all the files one by one from an example folder C: \ folder \ all those that have a txt extension. but I do not know the names of each file because they are random. after reading it would be convenient to eliminate...
asked by 30.11.2017 / 14:27
1
answer

Problem with Turbolink in ruby on rails

My problem is as follows, I am setting up an administration panel and in my navigation I have the classic buttons to minimize the navigation bar and the dropdown for each action that has an subaction and everything works in a startup but I move...
asked by 20.11.2017 / 01:05
1
answer

Create Roles for Users with Devise

I have an application in Ruby on Rails, I use the gem devise to authenticate my users but I have to assign roles to those users (Main Adm., Article Manager and User). I would like to have routes and views for each user. They could tell me how...
asked by 19.11.2017 / 05:39
1
answer

help with locked code and ilogic error ruby

Greetings. I have the following problem was finishing validating the following code and and it works well if I place a whole number works but it does not work well as this is the image I think it is a problem of the meter because if I omit it w...
asked by 15.11.2017 / 21:03