I am hosting my assets on s3. In production, rails is looking for /javascripts/cache/all.js and /stylesheets/cache/all.css. I'm using a plugin to swoop the public directory over to s3 when I deploy with cap. The problem is that rails doesn't create these cache files until they are requested for the first time, so they aren't around du...
I'd like to install a plugin but I'm afraid it's going to install a lot of unnecessary stuff. I'd like to look at whatever file rake takes it installation instructions from and remove anything unnecessary.
I believe this is the Rakefile. But I'm not sure what happens when rake looks at the rakefile - does it execute the entire rakefile ...
I was planning on using RoR for an upcoming e-commerce site but keep reading
comments that give the impression that this framework is not yet fit for this type of a commercial application.
What is the state of it? May it be used for large scale online stores etc?
Is compatibility and the frequently changing framework an issue to worry ...
Hello,
I have a Rails app where I set a set a session variable the moment a user lands on my site with the referer and the page they hit. Additionally, I have Google Optimizer sending traffic from my homepage to various landing pages. The problem is that I think Google Optimizer is sending users away before the cookie is set.
Is t...
I am about to build a basic online image editor for my web application using rails and rmagick. I did a bit of googling but couldn't find any existing solution, however I'd like to be sure before I spend a lot of time rolling my own.
Is anyone aware of a plugin/gem that provides a pre-rolled image editor with undo/redo and minimal image...
Hello peoples,
I am using JRails with Ruby on Rails so that I can simply use jQuery since I am more familiar with it. I am also attempting to use Low Pro to submit some of my forms remotely.
I am currently running into an interesting problem that has me stumped. I have added the following to my application.js file and I know that these...
I just installed a gem but when I type
gem_name --help
It says:
'gem_name' is not recognized as an internal or external command
However, when I type
gem list --local
the gem shows up in the list so I know it's there - I just don't know how to see what it does.
Is there a different instruction to use to find out what commands ...
I have fixtures with initial data that needs to reside in my database (countries, regions, carriers, etc.). I have a task rake db:seed that will seed a database.
namespace :db do
desc "Load seed fixtures (from db/fixtures) into the current environment's database."
task :seed => :environment do
require 'active_record/fixtures'
...
General Confusion
I have bands which can have 3 genres. I read in a previous SO post that the proper way to handle this is a couple steps:
1) In band.rb
has_and_belongs_to_many :genres
2) Create a band_genres join table
Even after reading the documentation, I am a bit confused as to what HABTM actually means. I guess I would just n...
EDIT -- the solution I posted below probably applies to any server (Nginx/Apache/anything else), because this header is set in Rails itself.
Anyone know where the "X-Runtime" header can be removed in Nginx & Passenger?
I've grepped the source files and haven't found anything yet, but I'd like to get rid of it for security since it's ...
My site allows users to upload csv files for processing. It all works
fine, but on the response I'd like to report something like "Your file
abc.csv processed OK".
Unfortunately I cannot seem to find the actual original file name in
the params, even though Firebug tells me it's part of the post.
Any tips?
Thanks....
...
Hi,
Due to a number of issues, my app is currently stuck in Rails 1.2.6-land. Converting it to Rails 2.3 is planned, but will be awhile.
Question: Does current Passenger support Rails 1.2.6? I've heard different things.
I'm currently using nginx and mongrels but 'dem dogs are getting tired.
Thanks!
Larry
...
Is there an easy way to obtain the average of an attribute in a collection?
For instance, each user has a score.
Given a collection of user(s) (@users), how can you get the average score for the group?
Is there anything like @users.average(:score)? I think I came across something like this for database fields, but I need it to work f...
I want this SQL query to be written in rails controller using find
select id,name from questions where id not in (select question_id from levels_questions where level_id=15)
How will I do this?I am using Rails framework and MySQL db
thanks in advance.
...
I have the following select list.
<%= select_tag(:editlevel,options_from_collection_for_select(Level.all, :id, :name)) %>
when the user selects an option from the above list, the list below should be populated with values from database based on the above selection.
<%= select_tag(:lques,{},{ :size =>10, :style => "width:200px"}) %>
i...
I have created the following table in sqlite3:
CREATE TABLE Test (
Id TEXT PRIMARY KEY NOT NULL,
Count REAL
);
But when I try to generate a model for this table, the schema.rb gives the following error:
Could not dump table "Test" because of following StandardError: Unknown type 'REAL' for column 'Count'
Is the...
Is it possible to redirect using a POST method ?
Or should redirects always be made using GET ?
The use for this is in the final steps of an order process for an e-commerce site, to send the data to the payment processor, without introducing an extra step for the user.
...
I have a rails application using the acts_as_rateable plugin.
I'm stuck on figuring out how to retrieve unrated models using this plugin - however this is more of a general rails/SQL question than specific to this plugin.
Acts as rateable adds the following to the schema:
create_table "ratings", :force => true do |t|
t.integer "r...
I am having a problem running the 'test' Rake task from IntelliJ Idea in Ruby On Rails application:
*Error running test: File 'test/unit/autorunner.rb' wasnt found in $LOAD_PATH of Ruby SDK with interpreter: '{1}'*
But the file is located at %RUBY_HOME%/lib/ruby/1.8/test/unit and I have no problems when running other rake tasks.
Plea...
Factory Girl is a handy framework in rails for easily creating instances of models for testing.
From the Factory Girl home page:
factory_girl allows you to quickly define prototypes for each of your models and ask for instances with properties that are important to the test at hand.
An example (also from the home page):
Factory....