Questions tagged as 'ruby'

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
1
answer

How can a class also be a method in Ruby?

See class Integer : Integer.class => Class It also seems like it's a method, at the same time it's a class: Integer 10.5 => 10 How is this possible in Ruby? Where is this method defined? What mechanisms does Ruby use to kno...
asked by 18.11.2018 / 14:14
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
1
answer

How to download videos from youtube and convert them to mp3 using ruby?

I need a simple ruby way, which allows you to download videos from youtube, but I only need the audio of the video (mp3).     
asked by 21.10.2014 / 14:53
1
answer

Enumerable and Comparable in Ruby

I read the Ruby documentation where it talks about the Enumerable and Comparable modules, but I did not quite understand what they do. Could someone give me some examples where I use them in my classes?     
asked by 28.04.2018 / 05:26
1
answer

Replace string by keeping the box (uppercase / lowercase)

What is the best way to replace a pattern with a string while holding the box? For example, DAdo - > LAdo or dado - > lado .     
asked by 05.02.2016 / 00:18
1
answer

Manipulate .txt file and put it in an array in Ruby

I need to, from a .txt file that has multiple tweets (one on each line), read this file and put it in a variable in the following format: [1, "texto da primeira linha do arquivo"], [1, "texto da segunda linha"] I was able to read the file a...
asked by 09.06.2015 / 19:38
3
answers

Running my AngularJS application on some server

I have a front end application consuming an api rails, but I'm new to this idea of separating the front end from the back end, my api runs on localhost: 3000, and my front is simply a folder that I go there manually and open my html page, I want...
asked by 25.09.2015 / 14:02
2
answers

Rails 4: Changing the "development" database from PostgreSQL to SQLite3 causes the rails server to give error

Hello. For some reasons, I had to change my DB "development" from PostgreSQL rails back to SQLite3. The page has stopped working and the error that appears in the rails server output is this: Started GET "/" for 127.0.0.1 at 2014-04-08 15:1...
asked by 08.04.2014 / 20:30