Ruby is an open-source dynamic object-oriented interpreted language created by Yukihiro Matsumoto (Matz) in 1993.
1
vote
1answer
14 views
How to reorder activerecord array based on array of ids
I have an existing activerecord array, gotten by the following:
@posts = Post.where(["created_at > ?", n_days.days.ago])
And I would like to order this array based on a value that needs to be ...
0
votes
1answer
27 views
Ruby symbol - What does it mean to a developer from a “static” language background
I cannot find anywhere a simple explanation to what a symbol in ruby actually means. I come from a 'static language' background (e.g. C#, Java).
When would you use symbols in Ruby? ... and why?
0
votes
1answer
37 views
Complex Rails/Postgres SQL optimization
Restaurant
has_many Dish
Dish
has_many Photo
Photo
belongs_to Dish
Restaurant 1
Dish 1
Photo 1 May 9, 1:00 PM
Dish 2
Photo 2 May 9, 2:00 PM
Dish 3
Photo 3 May 9, 3:00 PM
...
0
votes
0answers
26 views
How do I refactor this object to lessen dependency on callbacks?
I have an Order object that belongs_to a BillingAddress and a ShippingAddress. I want to present my user with only ShippingAddress fields and a checked checkbox indicating that the billing address ...
0
votes
0answers
46 views
Ruby beginning suggestions [closed]
i am an graphic and web designer... i have no programming background and i was hanging out in freenode server at #ruby channel. people suggest me to some exercises pages like,
...
0
votes
1answer
9 views
how to change the values in a combobox dynamically in Ruby Tk
The idea is quite simple: I have 2 comboboxes. The second one should refreseh its values depending on the chose from the first one.
# combobox 1:
$shape = TkVariable.new
$combobox_1 = ...
3
votes
4answers
70 views
Is Cron the only method to run scheduled tasks?
Is cron(or its derivatives) the only method to run scheduled programming tasks? For example:
Charge clients' credit card at 3 days before X
Send e-mail 6 hours from time x
Execute xyz command every ...
0
votes
0answers
11 views
Rails execute script on server on Dojo Button click
I've ruby script as part of rails application which is used to copy files from some directory to another inside the server. I am using Dojo as front-end. I've a dojo widget which is displaying a ...
0
votes
2answers
39 views
Displaying errors in Ruby on Rails
I have trouble displaying errors in Rails.
Here is my controller
def new
if current_user
@edible = Edible.new
else
flash[:notice] = "You need to be signed in for this ...
0
votes
0answers
5 views
Finding a script name with an Aptana 3.4 snippet
Using a snippet keyword in a JavaScript editor, I want to be able to derive a 'classname' from the name of the file in order to seed some comments and functions for implementation. Forget about the ...
2
votes
3answers
29 views
Is there an easy way to emulate Dir::glob?
I have a list of filenames and I want to implement Dir::glob on that.
I thought that was easy because there is File::fnmatch which looks like the right tool for that. However, both methods behave ...
0
votes
0answers
12 views
Ruby DataMapper: Conditions through associations
I have a class Expression which belongs to a Language and which have a many-to-many relationship with a Concept. So, an Expression belongs to a Language and a Expression can have many Concept, and at ...
0
votes
4answers
25 views
How do I include title and class attribute in link_to?
I'm trying this:
<%= link_to 'Test', '#', {title: "this is my images tooltop message", class: "tooltip"} %>
Which returns the following HTML:
<a href="#" ...
0
votes
0answers
10 views
rvm install error running 'requirements_osx_port_install_port'
Im trying to install rvm on my machine and select a version but im getting this horrible error can anybody help? I need to install dandelion deploy but cannot due to this problem.
Error running ...
0
votes
0answers
10 views
How do I redirect to another script using CGI?
I'm having a problem with CGI.
I'm developing an app using CGI in Ruby, not in Ruby on Rails. I have a CGI script in which HTML tags are there to enter the values in a textbox, and, after clicking ...