Questions tagged as 'ruby-on-rails'

3
answers

Where to put this logic? Controller or Model?

My application has the following logic: Given a received link, the application takes the <title> attribute of the page and transforms this attribute into the link description and saves it to the database. I put this logic in...
asked by 31.01.2014 / 12:57
3
answers

Is it more sensible to use client-side validations in Rails?

According to your own experience is it better to use client-side validations? Because if we analyze, Rails, in the standard validations, sends the request, does the validation and then returns the errors. This process, although not time consumi...
asked by 20.05.2014 / 21:13
2
answers

Should I use symbols in hashes and parameters to optimize memory usage in Ruby?

In this other question here I asked about :symbols and 'strings' and found that using :symbols optimizes memory usage by the application. My question is whether the same is true for creating hashes: hash = {:indice =&...
asked by 25.04.2014 / 13:41
1
answer

Influence of ":" in Ruby

The data validation parameters of the Ruby on Rails Framework use values with : before and after the word. validates :terms_of_service, acceptance: { accept: true, message: 'Mensagem de Validação' } validates :city, presence: true H...
asked by 01.07.2016 / 00:28
2
answers

Separate one column from the bank in two and pick up the values of the already created users

I have a user table in the database that has a NAME column, but it will be necessary to separate NAME and SURNAME. My question is: will users already created in the database have to be edited one by one? Or does it have some command that I can b...
asked by 08.03.2018 / 15:40
1
answer

Rails sidekiq in production

I am trying to build and produce an APP that uses Redis and Sidekiq for jobs in queues. In development it works as follows. Rodo the command in the terminal: bundle exec sidekiq -q default and let it roll. When I send the processes to the q...
asked by 21.03.2016 / 14:20
1
answer

Syntax error, unexpected keyword_end, expecting end-of-input

I'm having a problem (It may be ridiculous but I do not know what to do). The following error is appearing: SyntaxError in Group :: GroupsusersController # create /home/bruno/Documents/sites/mymoney/app/controllers/group/groupsusers_controlle...
asked by 30.01.2014 / 18:29
1
answer

What is the difference between Controller and Helper methods?

Architectural and Conceptual Doubt: I have a model Item that has attributes nome_ptbr and nome_en . I've done the following method: def display_nome nome_ptbr || nome_en end Where should I put these methods in...
asked by 13.05.2014 / 16:05
2
answers

Arrange jQuery Ruby On Rails

I have an app in rails 4 and after doing the scaffolding it generates a * .js.coffee for each template, as I am not yet using coffeescript renamed to * .js and I am trying to use jQuery. The problem is that I need to trigger a process delayed by...
asked by 22.08.2014 / 04:07
2
answers

Association has_many through [RAILS 3.2]

I'm having problem with a has_many , through association in a project I'm working on. In the case I need to model a relation that adds the order attribute to the relation table. To try to model the relationship I looked for a...
asked by 07.12.2018 / 20:36