Questions tagged as 'ruby'

1
answer

Rails - Undefined Method 'client' for 'Book'

Hello, I'm working with ruby on rails and I'm getting the error: 'undefined method', as in the image Theemployeeisworking,andifIputonlythebook.cliente_id,itworks.Followthecodesbelow:view->_livro.html.erb<%=livro.nome%><%=livro.departam...
asked by 18.05.2017 / 08:55
2
answers

Add new fields in migration?

Hello I'm working with Ruby On Rails, and for platform authentication I'm using gem 'devise'. I came across a situation where I need to add new fields for user registration (Date of birthday, gender, etc ...) and the device only provides me the...
asked by 25.05.2017 / 15:03
1
answer

How could I add an ICONE inside a SELECT in HAML

Hello, I would like to add icons (from source, such as bootstrap for example) inside a select field in HAML, at first I'm doing so, would that be possible? I thought about using the bootstrap list-dropdown as a palette, but it did not work either...
asked by 27.09.2016 / 14:22
1
answer

New fields should be nil, what to do?

I am using Devise, I do not want to use email for authentication, I want to use an enrollment, so I have read the Devise documentation and made the following adjustments, but the error still persists, it does not recognize the enrollment paramete...
asked by 06.09.2016 / 22:56
1
answer

How to execute shell script to restart server by application

I need to run a shell from rails with a small difference, I need the script to continue running even if the server process (puma) is killed. I added an update system inside my application, but I need to restart the server to work the changes....
asked by 06.09.2016 / 21:36
1
answer

Failed to install gem mysql in Linux Manjaro

It's been a while since I started playing with Ruby on Rails on Ubuntu and created some projects. Currently I installed the distro Manjaro and I installed the ruby and rails and I want to run my project created in Ubuntu, however I am facing...
asked by 31.08.2016 / 16:59
1
answer

I would like to create an object equal to a query in the database

I would like to create an object with fields equal to that of the ActiveRecord query, but with the fields pre-filled or blank, so that they are called in the same way in the other file ... For a better example, the code snippet I def...
asked by 22.09.2016 / 22:42
2
answers

Read file and search word

I'm putting together a script that will open a text file, play the words in a array , and then capture the index of the word, so alright I can get the word index , but I need to go through all array and if I have the word repeated,...
asked by 22.09.2016 / 22:54
1
answer

Autocomplete rails 4 + jQuery

Good afternoon, guys! I have the following scenario: a model city where all the cities of Brazil are already registered, and I have a view companies where I will register the companies and I want to create an autocomplete field for name of th...
asked by 09.08.2016 / 20:18
1
answer

Ruby on Rails - .html.erb file does not update on server

I modified the show.html.erb file, but the changes are not displayed on the system, I started to tinker with ruby in redmine, could it be cache or does it require some compilation in the modified file?     
asked by 19.08.2016 / 21:41