Hello all,
I've never used the ARCHFLAGS command before and am in way over my head.
I'm struggling with getting the MySQL gem working on Snow Leopard in 64 bit.
What I'm doing is this command:
sudo env ARCHFLAGS='-arch x86_64' gem install --verbose --no-rdoc --no-ri mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
The...
consider this code
class User < ActiveRecord::Base
has_many :views
has_many :posts, :through => :views, :uniq => true
has_many :favorites
has_many :posts, :through => :favorites, :uniq => true
has_many :votes
has_many :posts, :through => :votes, :uniq => true
end
# controller code
user = User.find(3)
posts = user.posts #...
I'm in need of a more complete example on how to update a select box based on the results of a second select box in Ruby on Rails. I asked about this already here. I've read through the feedback from that posting, but am not having any luck figuring this out, and I've been trying for hours. Anybody know of a better (and more complete) ex...
I'm trying to implement thinking-sphinx across multiple 'sites' hosted under a single rails application. I'm working with the developer of thinking-sphinx to sort through the finer details and am making good progress, but I need help with a maths problem:
Usually the formula for making a unique ID in a thinking-sphinx search index is to...
I was trying to debug why <%= @user.address1 %> wasn't showing up in the view. The associated column was setup as a string, as in:
t.string "address1"
t.string "address2"
t.string "city"
t.string "state"
t.string "zip"
t.string "phone"
When I debugged the model using debug(@user), I got:
address1: 123 Main St.
city: Sant...
I have such angry associations: financings >- events >- subprograms >- programs. I want to get acces to last_financings from programs through all of them so code is:
class Fcp < Program
has_many :fcp_subprograms,
:foreign_key => 'parent_id'
has_many :subprogram_last_actual_financings,
:through => :fcp_subprogra...
How do I debug the rails gems? I've just found the beauty of ruby-debug and am real excited, but I want to step through the routing code in action_controller, but the debugger isn't set up at this time, it seems like it's just skipping over my "debugger" calls in action_controller/routing/route_set.rb for example.
What am I missing?
...
Does anyone have more recent stats on the speed gains in SqlSessionStore over ActiveRecord Session Store? Is anyone out there using SqlSessionStore because of gains over ARStore?
More of a curiosity I guess. Seems there isn't a lot new on the SqlSessionStore side since like '07, even though the github.com repos show updates as late as ...
Hello,
I'm planning to make an application that needs to store dates way before 1970. Maybe even BC dates. Do you think I should store and handle that manually or can I use the Date/Time classes in Rails or use some plugin?
Thanks,
Tam
...
I'm having problems actually sending via ActionMailer in development, on my localhost, with Rails 2.3.2 and Ruby 1.8.6. The development.log shows that it has "sent" the email with no errors, but the email is not received. I have tried multiple email addresses for sending and receiving and have tried multiple configs and plugins, but cann...
I'm trying to deploy simple Rails app on glassfish v3 and get the following error:
org.jruby.rack.RackInitializationException: Could not find RubyGem activerecord-jdbc-adapter (>= 0)
Environment details:
App is packaged as war using warbler.
JRuby 1.4.0 installed locally, with activerecord-jdbc-adapter gem installed.
App is configured...
Hi,
I'm working on a rails project and I experienced that the response to ajax calls are slow in both development and production. Response comes around 8 sec. I observed also that i have some actions that has a response time around 80ms. The difference in the two acitions is that the slower was rendered using render :update do |page| .....
hi all,
regarding ruby on rails.
In the autocomplete field, when the user selects tagname, i need to get the back end tag_id. the way we do in selection box, where it is possible to get the value as an id
in the autocomplete field plugin.
and when the user can select incremental selection separated by , .
i need to get the selected i...
Say there're two models : User and Post, i want to keep track of who has read which post, and who writes which post, which user favorites which posts etc. Then i come up with the following solution:
class User < ActiveRecord::Base
has_many :writings
has_many :posts, :through => :writings
has_many :readings
has_many :posts, :thr...
My application requires to keep large data objects in session. There are like 3-4 data objects each created by parsing a csv containing 150 X 20 cells having strings of 3-4 characters.
My application shows this error- "marshal data too short".
I tried this-
Deleting the old session table.
Deleting the old migration for session table.
...
Am using 'devise' gem for authentication and rspec for testing. My problem is after spec execution the test data is not getting cleared from DB, because of this subsequent execution of specs fail. Following is the spec:
describe User do
it "should return a valid user when valid email and password are used" do
user = User.new(:email...
I'm looping through an array of URL strings of images hosted at an external site.
It looks something like this:
def get_image_urls
image_url_array.each do |image_url|
puts image_tag image_url
end
end
Which will return the URLs of images hosted on the external site. The problem is, some of these images might be broken (404). S...
I've got everything working with ferret and acts_as_ferret for development (or localhost DRb), but I can't get my multiple host deployment working. All of the remote systems get ECONNREFUSED when accessing the port. On the ferret server, the daemon is listening on localhost only despite the configuration listing the FQDN as the host.
...
This is working as is, but I'm pretty sure this is sloppy. Any tips on how to get all of this logic more rails-ish? I'm trying to implement will_paginate with this, but first I need a cleaner way of selecting the right records.
#shoe table
-------------------------------------
size | brand | color | sold
-----------------------...
Hello,
I have a question with regards to this tricky situation. I have code for a single select box where I can select a year, and based on the year, I want to return all possible values pertaining to that year in another select tag....
<%= select "month_end", "year", MonthEnd.find(:all, :select => 'DISTINCT year', :order => 'year').c...