How to specify gem dependencies in a way that user with only ruby, rake and rubygems installed could issue a single rake command to install all the dependencies required? Is it possible to use the same dependency specification when building gem with GemBuildTask?
...
I would like to use postgresql with foreign keys to define relationships in data so that other platforms/apps would also be able to easily use the same database. Having some kind of ruby DSL to define database schema with migration support would also be great. Which framework would you recommend for me?
Is there some kind of framework f...
Give a string "5 900 000" i want to get rid of the spaces using gsub with a following pattern:
gsub.(/\s/, ''), but that doesn't seem to work. Nor the gsub.(' ', '').
Any ideas guys (ang girls) ?
...
I seem unable to install Gitorious. I am trying not to install Ruby Enterprise Edition, but apart from that I have been following the instructions for Ubunut (there were some errors but I have gotten around those). I have installed a number of missing packages and gems, but now I am stuck when I try to migrate the database. I get the fol...
Hello all,
I have an array of hashes in a Rails action which i return to client in json format:
{"msg": "Got report data.Check 'report' json object. ", "success": true, "reports": "[{\"total_transfers\": 0, \"total_keywords\": 0, \"keyword\": \"plum\", \"total_duration\":1464.0, \"total_calls\": 22, \"total_sms\": 0, \"avg_duration\": ...
There is an ApplicationHelper in an engine we're using that looks like this:
module ApplicationHelper
def page_title()
# ...
end
end
This gets called by a number of views in the engine. I'd like to override this method in my application to provide a different default title. How do I do this? Simply defining my own ApplicationH...
I've put all of my user-authentication code in one place, namely lib/auth.rb. It looks like this:
lib/auth.rb
module Admin
def do_i_have_permission_to?(permission)
# Code to check all of this goes here
end
end
I include this module as part of the application helper, so these functions are available in all the views:
appli...
I have an Xcode project of RubyCocoa and need to debug it. Leopard already comes with Ruby installed. I read that there is a need to install a debug-ruby. My question is:
RubyCocoa site says that in order to debug Ruby a debuggable version should be built in the ruby source directory. Where should I build it on Leopard?
Thanks,
Nava
...
I have form in views/users/show.html.erb
<% form_for [@user,Wall.new] do |f| %>
<%= f.error_messages %>
<p>
<%= f.label :message %><br />
<%= f.text_area :message,:rows=>4 %>
</p>
<%= f.hidden_field :sender_id,:value=>current_user.id %>
<p><%= f.submit "Submit" %></p>
<% end %>
and I have this validation method in Models/wall.rb
vali...
hi all
I have a product model that has many sections and a section can belong to many products.
The section model has subclasses as features, standardAccessories and OptionalAccessories in a STI. Each having field title, body, image url and (optionalAccessories) has price.
my models are
class Product < ActiveRecord::Base
has_and...
One of the things I like about Netbeans Ruby development is keyboard triggers.
For example, if you are in an erb template and you type:
licai
After you hit the tab key, this text gets replaced with:
<%= link_to "${1 default="link text..."}",
:controller => "${2 default="items"}",
:action => "${3 default="edit"}",
:id => ${4 defau...
I have an app that has is up in a few environments i.e. (development, staging, beta, live)
What's the best way to pass in an app's domain name when sending mail, to allow for different domain names depending on the server?
My first thought is to add something in the respective environment.rb files for each one, so config/environments/b...
Using Perl, Python, or Ruby, can I write a program, probably calling Win32 API, to "click" on the screen at scheduled time, like every 1 hour?
Details:
This is for experimentation -- and can the clicking be effective on Flash content as well as any element on screen? It can be nice if the program can record where on screen the click...
Hi
I'm trying to validate the following XML against a XSD schema using Ruby.
It simply won't work, stops with an error message telling me
Error: Element 'request': No matching global declaration available for the validation root.
Maybe it's the namespace? I'm desperate. Please help. Thanks!
XML:
<?xml version="1.0" encoding="UTF-...
On Linux and OS X, I'm accustomed to running Rake tasks in specified Rails "environments" by doing this:
$ export RAILS_ENV=monster_island ; rake monsters:destroy_all
How can I do the equivalent if I'm running the task on Windows XP in a Windows console?
...
Hi All,
I'm looking for a mechanism in Rails by which to facilitate multiple drag-and-drop items simultaneously. Basically I want to select multiple and drag. Obviously I'd prefer to stick with standard HTML items and javascript, but if this isn't possible I'll consider a straightforward Flash implementation.
Thoughts?
...
I have this code in vendor/{engine}/app/helpers/application_helper.rb:
module ApplicationHelper
def application_title()
"Foo"
end
def other_method()
# ...
end
end
And this in app/helpers/application_helper.rb:
module ApplicationHelper
def application_title()
"Bar"
end
end
I get "Bar" as expected when callin...
Possible Duplicate:
What is the best way to learn Ruby?
There's tutorials on Rails but it's hard to find good on-line tutorials for Ruby.
What's your favorite one?
...
Is there anyone out there that is currently deploying rails applications on a solaris 10 box? If so can you give me a brief run down of what you had to do to get it up and going?
I am a web developer and I am working in a closed environment where they are using sun solaris servers, all of which are for internal use only behind firewall....
What are best practices for migration management?
For instance, when debugging a migration, do you edit the original migration or add an edit migration before committing to the repository? Thanks!
...