Tagged Questions
Ruby is an open-source dynamic object-oriented interpreted language created by Yukihiro Matsumoto (Matz) in 1993.
-1
votes
0answers
16 views
Simple “include” issue
I'm doing some pre-work for a class. Here is what we have to do: "In this case, we want to use cos on our acute angle, but we can't simply call cos because we haven't included Math yet. And we don't ...
0
votes
0answers
8 views
Building an HTTP RESTful API (specific to Ruby)
I have a mysql schema full of information that I'd like to expose with a RESTful API, preferably in Ruby.
What I know so far
"RESTful" refers to following a certain standard for your API, and is ...
0
votes
2answers
10 views
How to post an array with HTTParty
I need to POST an array with HTTParty.
My array is [1, 2, 3] and the API expects to receive the body to be in the form
"story_hash=1&story_hash=2&story_hash=3"
It's not really important ...
0
votes
0answers
7 views
rspec - getting “Locating textareas with '#text_field' is deprecated.”
I have a test assertion:-
expect(browser.text_fields[2].id).to eq "new_user_email"
It passed but I am getting this deprecation warning message:
Locating textareas with '#text_field' is ...
0
votes
1answer
15 views
Rails: Dependent delete_all not working
I have 5 models. Server, Platform, Game, RetentionReport, DataReport. And I am trying to use :dependent => :delete_all, but it wont work. Here are my models.
class Game < ActiveRecord::Base
...
0
votes
1answer
31 views
How to create and object dynamically from given attributes?
I have an excel files importer. I want to import records from excel sheets, which have column names with attributes names.
class DDImporter
def initialize(path)
@path = path
end
def ...
0
votes
1answer
13 views
Net::HTTP not sending request
I have the following method in our Ruby 1.8.7 project:
def self.ping_server
request_data = get_request_data
uri = 'another_server.our_company.com'
https = Net::HTTP.new(uri)
https.use_ssl = ...
0
votes
0answers
7 views
autocomplete notepad++ for the private libraries
I am using notepad++ for ruby coding also I am using autocomplete feature.
but i dint found any plugin to parse the "require " statement and autocomplete from that file options?
any help/suggestion
...
0
votes
0answers
4 views
Gumby-Framework rails gem
I've added a rails gem that contains submodules, and this defined the submodule dependency within my Gemfile:
gem 'gumby-framework', :github => "TeckniX/gumby-framework", :branch => 'master', ...
1
vote
0answers
9 views
ActiveAdmin edit resource at index page
I have one resource(Song) in ActiveAdmin.
Now it has default index page.
How can i edit fields in this page.
I have a lot of resources(~10 000), so I need to update image(Paperclip) and one ...
2
votes
4answers
31 views
Comparing identical DateTime objects in ruby — why are these two DateTime.now's not equal?
In a rails app, I have model code of the form:
def do_stuff(resource)
models = Model.where(resource: resource)
operated_at = DateTime.now
models.each { |model| some_operation(model, ...
0
votes
1answer
17 views
Cron job that calls a url for a rails app every 1 minute
I need a cron job to write into my crontab that every after one minute calls a URL of rails application that triggers a method and runs a scheduled job.
I did not use whenever gem because it reboots ...
1
vote
0answers
13 views
Using Launchd with Mavericks and Ruby
Upgraded to Mavericks and now launchd / Lingon is unable to launch Ruby scripts. I have the files set to be executable (using chmod +x), and have the first lines set to
#!/usr/bin/ruby
However, I ...
-1
votes
0answers
18 views
rails nested form issue
I have some form that throws an error :
<%= form_for @dee do |f| %>
....
<%= f.fields_for :tags do |t| %>
throws uninitialized constant Dee::Tag. And in my models I have in dee.rb
...
0
votes
1answer
25 views
What does “self.included(base)” mean in a module?
I see this pattern a lot:
module Article::Score
def self.included(base)
base.send :extend, ClassMethods
base.send :include, InstanceMethods
end
module ClassMethods
...