ruby-on-rails

how to run rails application

i installed rails gem on my machine gem install rails-0.9.2.gem nd i got message like Successfully installed rails, version 0.9.2 now try to run a command like rail amit but nothing happened not even a single message??? ...

Error: cross-thread violation on rb_gc()

I'm new to Ruby on Rails. I ran the following in a terminal when I was going through creating a blog tutorial with Rails: $ rails blog [BUG] cross-thread violation on rb_gc() (null) Abort trap How do I determine what this error message means and how to fix it? $ gem env RubyGems Environment: - RUBYGEMS VERSION: 1.3.7 - RUBY V...

JQuery UI Button Icons not displaying

Hi, I'm trying to apply an icon to a jquery UI styled button in my Rails app. The button is styled correctly but I just can't get the icons to show up! Could anyone give me any suggestions - I'm pulling my hair out! I've done the following: 1) Copied the javascript files (jquery-1.4.2.min.js and jquery-ui-1.8.2.custom.min.js) to public...

Software Product Support Website - Issue Tracking

I am hoping to release my first Android application (yay) and am doing some research on a self hosted (i.e. PHP or RoR) simple support based website where customers will be able to login and report/track issues. The critical required feature for me is some mechanism where customers will be able to vote on feature requests... where most ...

searchlogic or ActiveRecord error undefined "local variable or method" for belongs_to association with different foreign_key

Hi folks, big problem u = User.username_like('hans').first # works u.projects # error undefined "local variable or method" for project What's wrong with that? Model Code class User has_many :projects end Class Project belongs_to :owner, :class_name => "User", :foreign_key => "user_id" end please help, thanks in advance :) ...

compare data on ruby

My users have some "Patents". On it, that's a boolean "Expert" who determine the level. The user logged in must be able to edit the patents from the other users that he is expert. The problem is the patent has no reference, only the boolean "Expert" and the name come from (belongs_to) the "Skill" who contain the id and name that can be...

How do you do GIS queries on Heroku using the shared database?

I have a table of geocoded locations with latitude and longitude. I'd like my database query to return a filtered list of them, ordered by distance from a fixed point. There are a few options which I've explored: Postgresql's earthdistance contrib is probably closest to my needs; however, I've found no indication that this is install...

Where is a good authlogic openid tutorial?

I have searched a lot but found only old tutorials that doesn't works with latest plugins, how can i found a good and updated (working) how to to setup openid authentication ? ...

Need caching techniques for REST service calls

I am building a Ruby on Rails application where I need to be able to consume a REST API to fetch some data in (Atom) feed format. The REST API has a limit to number of calls made per second as well as per day. And considering the amount of traffic my application may have, I would easily be exceeding the limit. The solution to that would...

RoR+Pass params from rjs to controller

hi i want to pass few parameters from rjs to controller i didnt get it right, please guide me i am using code given below page << "var name= prompt('Enter the name:'); " if page[:name] page.redirect_to :action => 'create_name',:controller => 'names', :new_name =>params[:name],:id=> user.id end page is redirecting but i coul...

Should controllers in MVC web applications be unit-testable?

It seems to me that web developers of different programming languages often share different opinions on this. For example, Ruby web developers (with Rails being the dominant framework) appear to think of controllers as glue code, which should have functional tests, but not unit tests. A similar attitude dominates in the PHP world, yet th...

How to get all models,controller,action and method names in Rails

Hi guys, In runtime we can get the current controller and current action names by controller_name and action_name methods like wise, I want to get all the remaining controllers and action names and models too if possible.. Any rails method available to get all the controller names and the action names in application controller. ...

Regex to check consecutive occurrence of period symbol in username.

I have to validate username in my app so that it cannot contain two consecutive period symbols. I tried the following. username.match(/(..)/) but found out that this matches "a." and "a..". I expected to get nil as the output of the match operation for input "a.". Is my approach right ? ...

rails3 rc1 with prototype and jquery

I have a rails3 project where I need to use prototype together with jquery - using the current Ruby on Rails 3 RC1 there is no example or documentation to use both together without problems. Is there a setup instruction or did anyone get both javascript frameworks running with the latest rails version? thanks, z3cko ...

Setting bash aliases for IRB ?

So every morning to boot up my server , I need to do the following tasks.. >> sunspot-solr stop >> sunspot-solr start >> script/console >> Organization.reindex >> Event.reindex >> Deal.reindex >> exit >> script/server Is there any way I can make a shortcut in my ~/.profile as an alias to perform all this for me without me typing it ev...

How much does it cost to run a social network on average in terms of hardware and bandwidth per user, with a Ruby on Rails average stack?

How much does it cost to run a social network on average in terms of hardware and bandwidth per user, with a Ruby on Rails average stack? ...

Rails route which disappears in application but is present in rake routes...

Hello, I have a mystic problem.... In my routes.rb I have some routes defined and for exemple resources :projects, :except => [:destroy] do get :edit_flyer, :on => :member get :guests, :on => :member end If I run a rake routes, I get edit_flyer_project GET /projects/:id/edit_flyer(.:format) ...

Ruby - Copy image from different server

Hi, I am using an api that has a list of images that I would like to save to my own server. Does anyone have any suggestions on what are the best ways of doing this? or what lib's I should be looking to use? Thanks, Ian ...

What's the best tutorial for learning Mongoid?

I'm new to Mongo DB and Mongoid (and still kinda new to Ruby on Rails). Since Ryan Bates dosen't happen to have a Mongoid Railscast, I need pointers to other good tutorials/screencasts. Thanks! ...

Find record, that has ALL associated records

Say, we have a "Person" and "Favorite" models. "Favorite" is what this person likes: "music", "video", "sport", "internet", "traveling" etc. "Person" HABTM "Favorites", and "Favorite" HABTM "Persons" I need to find a Person, that has ALL listed "Favorites. For example, find a person, that likes "music", "traveling" and "sport". How ...