Questions tagged as 'ruby'

2
answers

Q. Rails undefined method 'full_name' for #Room: 0x0000000ed6d478 [closed]

My Controller: class RoomsController < ApplicationController before_action :set_room, only: [:show, :edit, :update, :destroy] def nome_completo "#{title}, #{location}" end # GET /rooms # GET /rooms.json def index @roo...
asked by 18.05.2017 / 17:02
0
answers

Read TXT / DAT file and parsing before saving to the database (mysql)

I have an application in Ruby on Rails whose function is to read a text file with the following "TXT / DAT" extensions, so I need a simple page (just an input field (file) and a button of submit) to send the file, the file itself has several lin...
asked by 17.05.2017 / 13:24
2
answers

How to set values for config's of my handler in tests?

My handler has 4 configuration variables: config :base_url config :details_path config :create_path config :token I hedge them and my lita_config file, but to test my handler, I need to set values for them in my specs too, how can I...
asked by 10.05.2017 / 15:51
2
answers

Read TXT file in Rails

I have an application in Ruby on Rails and need to read a particular txt file that will be sent by the user. After sending the file, the data of the file will be displayed to the user so that it confirms if the file is correct, and if yes, t...
asked by 09.05.2017 / 13:51
1
answer

Adding Array in a hash during a loop does not persist the data until the end

I've come to ask you for help because I can not see where I'm wrong, certainly bullshit. I am reading a csv and structuring this data in a Hash , where I have header as key and array hashes as value. def program...
asked by 09.05.2017 / 14:55
0
answers

How to make a timer from a set date?

I've done a little system that logs the tasks. The user logs on and registers a title with a description and a date of type datetime in the database. In the system it can view your tasks, delete and edit. I would like to add a timer type that...
asked by 21.04.2017 / 00:52
1
answer

Nested Wrong Translation Inflection

Opa, The problem is as follows: I have a Model Call Idea and I am trying to add a new nested in it to IdeaCategory which is an associative with Idea. Then we have: Idea: has_many: idea_categories, inverse_of:: idea, dependent:: destroy a...
asked by 09.04.2017 / 03:34
1
answer

Does anyone know how to solve this problem: can not load such file - rubygems.rb (LoadError)

I've already removed ruby and everything and updated the system, but this happened after the Jekyll update : 1: in require': cannot load such file -- rubygems.rb (LoadError) from <internal:gem_prelude>:1:in ' I can not run a...
asked by 15.04.2017 / 18:09
1
answer

devise get logged in user

I have a simple application using ruby on rails to gem rails admin and devise to authenticate I have a model called task where every task belongs to a user, so I would like to get the user who is logged in at the moment and assign it automati...
asked by 28.03.2017 / 15:33
1
answer

How to mock a non-existent class with Rspec Mock

I am creating a lib that will use a model of Rails , but for the development of this lib I need to test without the presence of this model . Then think of mockar (I'm using the gem rspec-mock ), so I tried:...
asked by 20.03.2017 / 20:00