Questions tagged as 'ruby'

2
answers

Is there a Python command similar to (Catch and Throw) in Ruby?

Is there in Python Something Similar to (Catch and Throw) of Ruby? I would like to jump like this: a = 10 throw :pularparaaqui if a == 10 catch :pularparaaqui do end     
asked by 05.07.2018 / 17:05
1
answer

What is "ensure" in Ruby? Give an Example

What is "ensure" in Ruby? Give a practical example in what situations it is useful. I'm studying this site here: tutorialspoint.com/ruby/ruby_exceptions.htm But it's not clear about 'ensure' exceptions. Would it be like the finally of Python?...
asked by 04.07.2018 / 00:38
2
answers

How to delete a DB data from the Ubuntu terminal? Ruby on Rails [closed]

I made a scaffold in the rails ... OK. Now to using the paranoia gem to give a software delete, but there is that ta, how do I give the command for example of this, in a post of mine? Which way ...     
asked by 29.12.2016 / 04:43
1
answer

Problems with wiselinks and turbolinks

I need that, after clicking a button, a modal appears, within that modal there is a populated form (or not) with rails objects. The problem is that I can not change the accept header to js so that rails render (not printe the code on the screen...
asked by 11.03.2014 / 04:18
1
answer

Installing rvm on windows 7 [closed]

You can install rvm or rbenv in windows 7, for ruby and gems versioning. If so, how do I install it on my machine? ... I already followed several tutorials that install rvm, but they do not work, I need something functional     
asked by 08.08.2018 / 15:40
1
answer

Error installing Compass on Mac

I'm trying to install the compass on my machine and I run into the following error. I'm using with command with sudo. Building native extensions. This could take a while... ERROR: Error installing compass: ERROR: Failed to bui...
asked by 30.09.2014 / 14:05
2
answers

How to group dates according to the month? Ruby + MongoID

I have a class that contains events and their start dates. I need to retrieve all records by grouping them so that the first few days are listed at a time. Example: 2014-01-01, 2014-02-01, 2014-03-01, 2014-01-02, 2014-02-02, 2014-03-02, ......
asked by 28.08.2014 / 16:56
1
answer

How to call a method with named parameters using a hash

I would like to know if you can pass parameters to a named parameter method via hash. Can you review the remaining parameters for another function as in the example below? params = {key: "value",key2: "value2"} def func(key1: nil, key2: nil, *...
asked by 11.02.2015 / 15:30
1
answer

How to give coverage for tests in completed Rails applications? [closed]

TDD is usually used during development. But when you get into a company, pick up the whole code zapped and see the urgent need for improvements and of course, coverage of tests? How to proceed? How do I test if all functionalities are implemente...
asked by 26.09.2014 / 22:17
2
answers

How to use for in Ruby?

I can not use for equal use in Java . I'm trying to figure out if a dice is a hook. An honest casino owner has cast%% of them, given the% of results of the rollouts, determine the number of occurrences of each face.     
asked by 13.04.2018 / 05:13