Questions tagged as 'ruby'

1
answer

NoMethodError in Home # index

Next, I received a challenge to create a login page, using devise and with the logged in user, so that he could create a to-do list. The login I could do and it works well, already creating the part of the posts is being the biggest problem....
asked by 01.08.2014 / 05:21
2
answers

Pull in database from heroku to local

I need to synchronize my bank's data in production with what's in my location, is there any way I can pull the bank from heroku to mine in localhost without having to create a new bank locally? My application uses the Mercury editor, so the clie...
asked by 21.08.2014 / 21:42
0
answers

Is there an MDI form for GTK 3 or 2 in Ruby?

Is there a class that defines an MDI form in Ruby GTK 2 or 3, similar to that found in other languages like Delphi, C #, VB etc.? Note: MDI is that form for desktop applications that one window opens inside another, that is, it is in the scope...
asked by 29.01.2014 / 17:00
1
answer

Button with a value - Ruby on Rails

I have 2 buttons and each one will have to send a value of the model and will also be submit button 1 and button 2 - depending on the button I click it will send the value to the field @ evaluation.type. Similar to a like and di...
asked by 08.05.2014 / 04:40
0
answers

caches_page in rails 3 does not work in production [closed]

In development, caches_page works normally, but in production, it creates the cache and rewrites the cache to each access. Anyone have any idea how this issue can be resolved? My config / production.rb file: AppRuby::Application.configure d...
asked by 03.06.2014 / 03:29
2
answers

Generate random numbers

I have the following problem: I need to generate a random number between 1 and 6 Assign a array of numbers if this new one is not contained in array If contained, regenerate. Do this process until the array of numbers has 6 numbers...
asked by 12.01.2016 / 12:14
1
answer

How to make a switch in Ruby?

How can I make a switch in Ruby?     
asked by 05.11.2014 / 15:46
5
answers

Error Division by 0

Hello I would like a help, I am starting with the language and I am trying some doubts, What I want in my code is that the calculation of the division is not divided by zero. At the moment I enter the value of Y = 0 return a message "Invalid,...
asked by 20.09.2017 / 21:56
1
answer

I can not convert sqlite rails app to postgres (for deploy heroku)

I have tried to do the conversion of a Rails app in sqlite to postgres in order to upa it in heroku, following this heroku's own tutorial: link But when I create a DB using rake db:create , I get this error message:    rake db: c...
asked by 16.11.2015 / 19:46
3
answers

How to find a letter in a string?

How can I test if a letter (stored in a variable) is contained in a word? ex: palavra = "palavra" escolha = "a" output    The word has 3 letters "a" in the word .... or     
asked by 01.03.2017 / 13:08