Hi everyone,
I am using pik to manage both ruby 1.9.1 and ruby 1.8.7 on one machine. Pik installed fine and I can switch between both versions, however with version 1.8.7 I cannot install rubygems. From the command line(I am on windows XP SP2 mind you) I try to execute the rubygems setup file:
ruby setup.rb
and i get this error: 'req...
I'm trying to use some radio buttons to be selected and use the parameter as a find condition for my model... SO far I have.
View
<% form_tag do %>
<p> <%= radio_button_tag :interest, "apple" %> Apple </p>
<p> <%= radio_button_tag :interest, "orange" %> Orange </p>
<p> <%= radio_button_tag :interest, "peach" %> Peach </p>
<p> <%= radi...
So I have read & re-read the Stephen Chu article on the topic (http://www.stephenchu.com/2008/05/rails-composedof-validation.html), however I am just not having any luck.
Per the example on provided in the money gem documentation money.rubyforge .org
Model
class Payment < ActiveRecord::Base
composed_of :amount,
:class_name => "M...
Hi,
I was trying to install RVM:Ruby Version Manager from:
http://rvm.beginrescueend.com/rvm/install/
I opened up my terminal in my mac os version 10.5.8 and use the command line
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
then I got the message,
"You must now finish the install manually:
1) Place the ...
Hi, I am really really new to Ruby On Rails, so I think it is a easy question.
I am setting up a OpenSource RoR application on a testing server. However couldn't get it
sending email though our Exchange server. The testing server and Exchange server are both set correctly, I can test that using other web application on the same server.
...
Using Ruby on Rails, how can I achieve a polymorphic has_many relationship where the owner is always of a known but the items in the association will be of some polymorphic (but homogenous) type, specified by a column in the owner? For example, suppose the Producer class has_many products but producer instances might actually have many ...
Hey guys another rails issue,
Currently have a collection that is line items for an invoicing system. I want to increment the count of the line items if I add in an item that already exists. At the moment I'm using an exists? query on the collection but it seems to return regardless of the key.
The foreign key I'm using is item_id, so ...
Suppose Songs have_many Comments; How can I:
Pull a list of all songs from the database sorted by the number of comments they each have? (I.e., the song with the most comments first, the song with the least comments last?)
Same, but sorted by comment creation time? (I.e., the song with the most recently created comment first, the song ...
I want to implement declarative authorization with mongoid. But cannot succeeded. It seems like declarative authorization works with ActiveRecord Only. Can I let it work with MOngoid and MongoDB? Any Ideas.
...
I have defined a problems method in my Report model. I need to use the value of Report.problem in the report's controller while defining the action show. But i keep getting the error message 'undefined method problem'. How do i solve this? Any assistance would be greatful.
I have a report model and a problem model that contains a list ...
I have installed yajl, libyajl-dev, and the yajl-ruby gem on a ubuntu 10.04 installation.
I added the gem to a 2.3.8 ruby on rails installation since the release notes for 2.3.6 indicated that yajl would be used if present in the system. Rails bails with an error message along the lines of 'unable to load yajl-ruby' so I thought I would...
I want to learn Ruby on Rails. It's my first web language. I understand that Ruby is a language, and Ruby On Rails is a framework. The thing I'm not clear about is whether I need to learn Ruby in depth first, and then learn Rails afterwords. Is that right?
Or is it better to learn them simultaneously?
And, while you're at it, what's t...
I'm using Ruby on Rails with jQuery and trying to do the following:
<%= link_to_remote (image_tag("delete.png"), :url => { :action => 'remove_candidate', :id => candidate }) %>
When I load a page and hit the link I get 'Ajax is not defined' error in FireBug console.
I understand that it's because I didn't load prototype, but load...
Think about the situation like this.... I have an application server, and a database server. An application will ask for database server information. The database server, of course, need a password. Also, having a SSL connection. Is it necessary to make the connection via a VPN network ? Also, I am using RoR to develop, is there any way ...
I'm working on a project in which I'm having slight difficulties coming up with the design for a seemingly very simple scenario:
user belongs to city which belongs to country, however, the city reference may be null while user must belong to a country nevertheless. In other words (in basic RoR model syntax),
# class User < ActiveRecord...
I am doing my application using RoR, which make me very annoying is the layout issue, I know the RoR have a really great MVC to isolate the UI out or the application logic, but it is still really annoying to work with CSS across different browsers. Is there any way to reduce that work load? thank you.
...
In one particular Railcasts episode Ryan talks about advanced search and in that he uses some code so as to find the conditions for the search. As its working isn't explained I wanted some clarification regarding it.
def products
@products ||= find_products
end
private
def find_products
Product.find(:all, :conditions => conditions)
...
Well this probably isn't specific to rails, but in my rails app, I have a page for a show action that contains a bunch of images (4-5 images 40-60kb each).
I don't need to show them all at the same time. I am wondering what's the best way to load them so that the page loads fast and the user experience is not sacrificed either.
Should...
Hi All,
Quick question. How can I get the Facebook ids of the current logged in user’s second degree friends or friends-of-friends?
Sample sites that do the same behavior are the ff:
vark.com
thread.com
...
Hi,
I know that I can use
<script type="text/javascript">
jQuery.noConflict();
</script>
to resolve the conflict between prototype and jquery after including all jquery and prototype libraries in the head section. However, I am including another .js file in the head section which dynamically loads a jquery plugin in window.lo...