ruby-on-rails

what is gem support Prolific Payment Gateway?

In authorize.net I used active merchant gem but activemerchant not support Prolific Payment Gateway. please suggest me a gem or way. ...

Ruby On Rails 3, form_tag remote on responding to Ajax request

Hello all, thanks for reading this post. I've been stuck on an issue with RoR for the past few days. I have a form under index.html.erb as: Ajax List Demo Listing posts <%= javascript_include_tag :defaults %> <%= csrf_meta_tag %> Add to list using Ajax <% form_tag :action => :list , :method=>:get, :remote=>true d...

Rails, Rackspace Cloud Files, Referrer ACL

Hi, I am using Rackspace Cloud Files as File Storage server for my application. The files that users upload must be authorized from within my application, then from a controller it would redirect to the correct Rackspace Cloud Files CDN URL. I am trying to do authorization using Rackspace Cloud Files' Referrer ACL. So let me just add a...

RMagick not maintained any more??

At the RMagick repo on Github, a message was uploaded yesterday saying the main author cannot continue to maintain the project, and is looking for new people to take over. (I would certainly crash it were I to ever attempt such a job!). You can see their readme here: http://github.com/rmagick/rmagick. In your opinion, where should a Rai...

Prototype Ajax.Autocompleter in dynamically added HTML does not work

Hey, this is the first time I've actually finished writing up a question without SO giving me the answer in the process. :) I've got a nested form (along the lines of Ryan Bates' Railscast tutorial on the topic) which allows users to dynamically add additional fields for adding/removing nested models using Prototype-based javascript. Th...

rails - Search Controller

Hello. I'm getting ready to build search capabilities into my app. I want the search to have the ability to span multiple models. I'm thinking about adding a search controller which would then decide which models to search based on settings etc... What do you think? Does a search controller sound right or is there something open-source...

RMagick not working

I'd appreciate any help with this - I'm sure it's a simple mistake. The location of my app is C:\sanj\rubyjobs. I have installed ImageMagick successfully in its default location: C:\Program Files (x86)\ImageMagick. I have also installed rmagick the gem by running gem install rmagick --local in C:\sanj\rubyjobs\vendor\RMagick Extract...

Accessing facebook interests with rails devise plugin

Hey! So i just got devise and fb login to work on my rails project, but I would like to get more info about the user when they log in. I added user_about_me to the scope of the request and that got me a lot of info, but I would also like to get the users music/movies/etc. I tried adding user_interests but it doesnt seem to send anything...

Do Rails controllers URL unencode params for me?

If a url parameter comes in urlencoded, does rails decode it for me, or do I have to call CGI::unencode myself? (I'm asking because I'm seeing what is I think inconsistent behavior, and may be a bug in either rails or rspec, but wanted to ask here first to get a sanity check) ...

Resolved :Listing users in rails +template error

Hi, I am very new to Rails. I am starting my learning process by first listing all the users. FIrst i had added a action in the controller as def list_users @users=User.find(:all) end And in the View users/list_users.html.erb i have added the line list_users.html.erb: <%= Time.now %> <% @users.each do |user| %> <%= user.firs...

Is Rails 2.3.8 or Rails 2.3.10 fully compatible with Ruby 1.9.2? (any reference or source say that?)

because if those Rails versions were not written with 1.9.2 in mind, then there might be slight usage difference that can break Rails. Actually, can any gem command tell a particular gem is dependent on what versions of other gems (and perhaps Ruby version too)? ...

Finding an array of ids while keeping the order with Rails and PostGreSQL

Hi, I have an array of ids of objects that I want to get from the database, but PostGreSQL returns them sorted by ids: Users.find([4, 1, 3]) => [User 1, User 3, User 4] I know I could sort them back like this: ids = [4, 3, 1] r = Users.find(ids) users = ids.map{|id| r.detect{|each| each.id == id}} But wouldn't it be better if I co...

What's special about :conditions => [a_field IN (.., .., ..)] ?

The following result sets work well with will_paginate: Members.all(:limit => 5).paginate(:page => params[:page]) Members.all(:conditions => ["member_no < 6"]).paginate(:page => params[:page]) Members.all.paginate(:page => params[:page]) The following does not: Members.all(:conditions => ["member_no IN (?)", [1, 2, 3, 4, 5]]).paginat...

Ruby/Rails: Determine variables from plain text to update via form

I'm creating an app where users can edit their own CSS (in SCSS syntax). That works fine, however, I eventually want these CSS files to be "programmable" so that users that don't know CSS can still edit them in a basic manner. How? If I can mark certain things as editable, I don't have to make an impossible database schema. For example ...

Rails cannot cache precalculated values across browser requests? (such as remembering n factorial results)

For example, the following code: class FoosController < ApplicationController def index if [email protected]? render :locals => {:bar => @foo} return else @foo = rand 10 render :locals => {:bar => @foo} end end end if I load localhost:3000/foos multiple times, it will show different values, and it is n...

Can't update rails has_many :through relationship

I try: @item.associations.update_attributes(:tag_id=>params[:tag]) and @item.associations.tag_id=params[:tag] Both give me undefined method errors for update_attributes and tag_id=, respectively. Here's my setup: class Item < ActiveRecord::Base has_many :associations,:foreign_key=>"item_id",:dependent=>:destroy has_many :rever...

Rails restful routes and singular resources

I am having a problem with restful routes and singular resources, originally I had this code in the show view on my account resource. <%= link_to book.title, book_path(:search => book.title) %> and it worked fine, then I changed account to be a singular resource, e.g from map.resources :accounts to map.resource :account and now...

Cucumber: Events should be listed in chronological order by event date

This cucumber-test wont fail even if I replace the order of the events. It should only pass if the order is in the chronological by event date. But its passes in whatever order i put the table in. What can the problem be? Scenario: Events should be listed in chronological order by event date Given I am signed into an account called "Gor...

RoR-software requirement for hosting website

hi, i am new to deploying ror website. i just want to know what are the software requirement in server side and requirement in client side and steps for deploying the application thanks ...

Script for download

How to write a script to download all videos from the links in a webpage Hey Guys, I want to write a script to download all rails screen casts from this location http://railscasts.com/episodes/archive Any ideas on how this can be automated? ...