With a new Rails 2.3.10 project, the file config/environment.rb has the following line commented out:
# config.gem "sqlite3-ruby", :lib => "sqlite3"
but for some reason, I tried a scaffold foo, and start the rails server, and the app is running.
I thought the requirement is, every gem the app needs, it has to be listed in config/en...
I didn't know that the old Rails guide is available by
cd railsproject_folder
rake doc:guides
cd doc/guides
and since our project has been using Rails 2.2.2, so the Rails guides for Rails 2.2.2 can be seen there, because the official Rails guide on web is for Rail 3.0.
I tried that with Rails 3.0.1, and it works too. With Rails 2.2....
Hello, I have a nested model form for PhotoAlbums. The form works fine via the standard html. But what I need to do is render it as a partial in another page it's erroring: "No route matches
{:action=>"create", :controller=>"photo_albums"}"
The models:
Projects
has_many :photo_albums
PhotoAlbums
belongs_to :project
has_m...
def find_users_online(count = 1)
users = Array.new
count.times do
users += get_users_online
end
users # <==== I want to remove this here
end
In the code above im must put the "users" variable again at the end of the function to return the right value (users). But is it possible that the times block ...
More and more gems I run into requires building "native extensive", such as RedCloth. Are there tools that are open-source or free that is sufficient to do that? I heard MS Visual Studio also has a free version. Will that be enough to build native extensions?
...
I find the integration with RSpec, Growl and rails particularly useful. However, it takes about two to three seconds before a change (save file) is picked up by autotest.
Is there a way to increase the interval by which autotest scans for filechanges?
...
Hello,
1 The following is more to point out to the code devs an issue of rails that can be percieved as a flaw.
2 And also me asking some oppinions from people who know better.
I want to add WebDAV to my Rails 3 App with Warden authentication. My warden middleware is injected via Devise.
http://github.com/chrisroberts/dav4rack
...
I'm using the following form tag for @jobs which have job_photos included.
<% form_for @jobs, :html => { :multipart => true }, :remote => true do |f| %>
The form works fine non-remote, but if I add the remote = > true, the form submits, returns create.js but doesn't save anything to the DB or error?
...
Hi ,
I have a moderately large rails ERP application having around 80 tables . I use MySQL . I recently received a client requirement which needs me to deploy the same application for roughly 10,000 offices(an instance for each office). The central office(superadmin office) must be able to view details from all these offices .
After tal...
I want to override an existing scope to add an extra condition to it. I've shown my attempt to do this using alias_method. Unfortunately this approach doesn't work with scopes, I get an undefined method error. How do I do it with scopes?
module Delayed
module Backend
module ActiveRecord
class Job < ::ActiveRecord::Base
...
I'm running Mac OSX 10.6.4 and setting up rails for the first time. I've been following a bunch of guides to get set up, specifically these two here and here. Also, I know this question has been asked before, but nothing has helped me and my circumstances are a bit different.
First, let me give you my setup.
I've installed Xcode, ...
A User can have many roles, but only one role per Brand.
Class User < AR::Base
has_and_belongs_to_many :roles, :join_table => "user_brand_roles"
has_and_belongs_to_many :brands, :join_table => "user_brand_roles"
end
The problem with this setup is, how do I check the brand and the role at the same time?
Or would I better off w...
I did a rake thinking_sphinx:rebuild, then when I try to update any page/entry, it does save but it returns error. New data is saved, but the page returns error. What have I done wrong?
Before I did the above command, things were working fine. I had to issue that command because I did some changes on the sorting filter.
...
Anyone here haveRails 3 with Uploadify & Paper_Clip experience?
I'd like to allow the user to upload photos:
Here is my view:
<input id="fileInput" name="fileInput" type="file" />
<script type="text/javascript">
$(document).ready(function() {
$('#fileInput').uploadify({
uploader : '/uploadify/u...
Hi,
There are conflict with inherited_resources and Ryan Bates's cancan gem.
I have some simple controller
class IssuesController < InheritedResources::Base
respond_to :html
load_and_authorize_resource
def tag
@issues = Issue.tagged_with(params[:tag]).recent.paginate(:page => params[:page])
end
protected
def collec...
I have 2 sets of data as following:
default_products - A set of active record objects retrieved from memcached
owned_products - A set of active record objects retrieved from the database
Retrieving the data is fast and i get around 30-40 req/s when just returning either one of the arrays yet as soon as i do the following to return both...
I'm new to using ruby on rails and was looking for help with image upload/manipulation. The extend of my RoR experience is the rails tutorial blog project, but I've used Java and PHP for numerous other projects. I'm trying to create a simple app where the user uploads a file, enters some text, and the text is overlayed on the supplied ...
If I drop in to irb and do require 'atom' I can successfully include the gem but if I try to include it in my controller in rails I get no such file to load -- atom when I visit the page in the browser. What's going on here?
Here's the complete stack trace:
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_r...
I and trying to build a calendar in ruby on rails.
In ruby-on-rails, monday is considered to be the first day of the week, but i have to set sunday as the first. I intend to change this to properly use the date's built-in methods RoR.
Assuming today is sunday, oct 24th. Look the example:
Date.now.beginning_of_week
it prints: 2010-10-...
I'm trying to save the Production environment log to the database on other server.. What I mean that when some errors shown I want to open ssh and check the end of production.log.. What I want is to go to the other database (on other server maybe) ant check it out.
I want the logged information to be the same as I see in the *.log, cont...