Ruby is an open-source dynamic object-oriented interpreted language created by Yukihiro Matsumoto (Matz) in 1993.
0
votes
0answers
3 views
RVM install issue - Unable to execute port (autoconf)
I'm trying to install Jekyll on OSX mountain lion. First of all I wanted to install RVM and then the latest ruby. However, the RVM install is failing and I can't solve the problem. Any help ...
0
votes
0answers
10 views
How do I Link_to an external URL in new tab/window and also run controller method?
I have a list of links being rendered from the database.
When a link is clicked I'd like the href to open in a new tab/window and to also call a controller method so I can update a database field ...
1
vote
0answers
11 views
How to increase page execution time in rails 3?
I want to increase my rail project page execution time for RAILS 3.
When i load page then in loop more than 1000 data in loop but only load around 136 data only because of complete page execution ...
0
votes
1answer
20 views
Ruby: Extending hash constructor
I'm new to Ruby, so apologies if my terminology is incorrect here.
I'm trying to make a subclass of hash, but am having trouble with initialising it. I want to be able to initialise it with an ...
1
vote
2answers
17 views
What is the best known option to dynamically add model fields in nested form?
I have following nested form. And I want to add dynamically multiple web_profiles to person by clicking + button. Right now like you can see in the controller I can add only one web ...
0
votes
1answer
12 views
How to find browser user-agent with selenium in ruby
I want to know current user-agent. I have used selenium2 with ruby
I have set user-agent in env.rb
Capybara.default_driver = :selenium
Capybara.register_driver :selenium do |app|
profile = ...
0
votes
0answers
12 views
How to group in mongo from ruby
I'm trying to group by 2 fields in my mongo collection from ruby. I've got it working from within the mongo client however can't get the ruby syntax right.
My command on the mongo client is
...
-1
votes
0answers
13 views
Sinatra - Nilclass with session variable
get '/blackjack/*' do
if params[:splat] == "/hit" and defined? session[:bj_game]
erb :blackjack
elsif params[:splat] == "/fold" and defined? session[:bj_game]
session[:bj_hum].fold = true
...
0
votes
3answers
28 views
get groups of characters n at a time
I'm trying to group a string by three (but could be any number) characters at a time. Using this code:
"this gets three at a time".scan(/\w\w\w/)
I get:
["thi","get","thr","tim"]
But what I'm ...
0
votes
0answers
15 views
Where is the gem ember-dev?
Digging around emberjs git repo, I found the file config.ru, which contains the line require 'ember-dev'. I started rackup without any errors, but when I then tried irb -rember-dev , I got a load ...
2
votes
3answers
39 views
Replace every other character
how could i skip or replace every other character (could be anything) with regex?
"abc123.-def45".gsub(/.(.)?/, '@')
to get
"a@c@2@.@d@f@5"
0
votes
0answers
10 views
Jruby : install redcarpet throw error
I want to install redcarpet gem in JRuby
I did
jruby -S gem install redcarpet
Fetching: redcarpet-2.3.0.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing ...
0
votes
2answers
23 views
What would the regex be to detect this string?
I need to determine if a given string has the sequence dash-alpha-alpha-dash.
Example strings:
114888-ZV-209897
409-II-224858
86296-MO-184080
2459-ND-217906
What would be the the regex to ...
0
votes
1answer
17 views
Regex flatten usage
I am using regex to extract a value from a variable. The output comes in this format:
[["\"XXX.YYY\""]]
So, I use flatten & it gives me this output:
["\"XXX.YYY\""]
How can I extract only ...
2
votes
2answers
28 views
Ruby: Want to use object as string
I am working with a library which uses strings as ids throughout. I want to make a class which can be used in place of these ids, but looks like a string to the existing code. E.g. I have an ...