I am wondering about rails versions.
I am in a project directory:
when I run "rails --version" I get v2.3.4.
when I run "script/about", I get a different answer, v2.1.1.
in environment.rb, I have the line "RAILS_GEM_VERSION = '2.1.1' ...."
Okay, so where is this rails v2.1.1? I thought maybe in vendor, but no, should there be? I ...
I have get data through wsdl but i am getting data but i can't use it .
is there any way to get proper data ? Due to spam protection mechanism i can't post source to SOF.
...
If I am not wrong then Rails has its own foreign key logic implemented using ActiveRecord. Is that to help performance i.e. so that you don't rely on the database for the additional processing logic or make frequent database transactions? Or is it for some other reason?
...
OK, I am writing performance tests and am having trouble getting my session to persist like it does in integration tests. As I understand it, PerformanceTest is a child of IntegrationTest and any integration tests should work with performance test. However, when I take a integration test and copy it over to performance, change the Acti...
I'm relatively new to rails and I'm working on a task which requires a similar functionality to the Cities tab here: http://haystack.com/cities . I've searched all the books and can't seem to understand the logic that makes all of this possible. The only thing I can think of is reverse engineer e-commerce code to do what I want. Does any...
Hi,
Is it possible to use delegate in your Active Record model and use conditions like :if on it?
class User < ActiveRecord::Base
delegate :company, :to => :master, :if => :has_master?
belongs_to :master, :class_name => "User"
def has_master?
master.present?
end
end
Thnx!
...
Im trying to integrate FBConnect to my application and want to know if the facebooker plugin is still applicable now that Facebook has made some revisions to its API.
...
I am trying to sending XML content through POST to a controller ('Parse') method ('index') in a simple Rails project. It is not RESTful as my model name is different, say, 'cars'. I have the following in a functional test that works:
def test_index
...
data_file_path = File.dirname(__FILE__) +
'/../../app/views/layouts/in...
With a standard map.resource routing mechanics and several nested resources the resultant routes are unnecessarily long. Consider the following route:
site.org/users/pavelshved/blogs/blogging-horror/posts/12345
It's easy to create in routes.rb, and I'm sure it follows some kind of beneficial routing logic. But it's way too long and ...
I'd like to do something like this:
some_method.should_raise <any kind of exception, I don't care>
How should I do this?
some_method.should_raise exception
... doesn't work.
...
Has anyone gotten the Globalize plugin to work Rails 2.3.2 or later? If so, could you direct me to some useful info?
...
I have my resources already defined, but a client wants to change the names of the URLs to match their brand (e.g. something like "catalog" when the resource is currently "products"). Can I specify a different controller name with a resource so I can get all the built-in resources functionality without having to actually rename the cont...
I am currently building a rails application based around insurance. There is an admin section where the staff can control the system tables, mostly what appears in drop down lists, although some are more complex with their own associations. The main model in this application is the policy, this needs to hold/link to information in many o...
I have problem with STI and relationship in ActiveRecord. I think I missed something in the class methods, but I don't know for sure. Below is my models:
class User < ActiveRecord::Base
has_many :advertisements
end
class Advertisement < ActiveRecord::Base
belongs_to :user
end
class FreeAdvertisement < Advertisement
end
class Paid...
In Ruby on Rails, for conditions, it's easy to make SQL-injection-proof queries:
:conditions => ["title = ?", title]
where title comes from the outside, from a web form or something like that.
But what if you are using SQL fragments in other parts of the query, like:
:select => "\"#{title}\" AS title" # I do have something like th...
My app seems to randomly be throwing a "undefined method `map' for nil:NilClass" error when users are trying to update their profile.
But what's weird is it's saying the error happens on update, but the error line is actually in a view.
Full error:
users#update (ActionView::TemplateError) "undefined method `map' for nil:NilClass"
On...
If I have a Model like the following example
class Person < ActiveRecord::Base
has_many :moods
end
class Mood <ActiveRecord::Base
end
how do I change the new.html.erb allow me to choose a mood when entering a new Person? Do I need to add the foreign keys to mysql manually?
...
any one know how to find a session by a session_id on RoR?
I'm using Authlogic in my project i don't know if that is correlated
...
I've got an app that could benefit from delayed_job and some background processing. The thing is, I don't really need/want delayed_job workers running all the time.
The app runs in a shared hosting environment and in multiple locations (for different users). Plus, the app doesn't get a large amount of usage.
Is there a way to start a...
I'm using the rakismet gem to submit user content to Akismet for spam testing.
So far every test I have done has classified the content as spam.
I'm starting to think I'm doing something wrong.
Does anyone know why I might be getting all false positives on my test data?
...