Hey there,
I'm having a little issue...I setup a rails application that is to serve a german website. To make use of Rails' internal pluralization features, I kept all my models in english (e.g. the model "JobDescription").
Now, if I call "http://mysite.com/job_descriptions/", I get all my job_descriptions....so far, so good. Because I ...
Hi, I'd like to get the objects that are updated in the last 10 seconds from the ActiveRecord's find.
I tried doing this
@chats = Chat.find(:all, :conditions => ["updated_at > ?", 10.seconds.ago] )
as well as
@chats = Chat.find(:all, :conditions => ["updated_at > ?", Time.now-10.seconds] )
and even
@chats = Chat.find(:all, :con...
I need to build several Rails applications for one client. I would like to give them all the same user authentication system so that users will not have to remember separate login credentials for each app. These are strictly internal applications. OpenID is not an option for this organization.
I am thinking of creating a central Rails a...
I am trying to figure out if there is already a plug in that does the interaction with iCal, Google APIs that I can use or do I need to just get my hands dirty and write it myself.
If anyone knows of good resources that I can look at that could help me with the implementation, that would be good as well.
I am new to RoR and I have be...
User model has three keys: is_master, is_standard, is_guest because I originally wanted to use activerecord boolean methods like is_master? or is_power?.
However, if it would be better to create a UserType relationship and create my own methods like this:
def master?
return true if self.user_type = 1
end
What's the best practice o...
I have the following Rails migration which works perfectly (irrelevant pieces removed):
create_table :comments do |t|
t.text :body
t.references :post
end
Now I'd like to add an author column to my comments table (which is the userid of a user), but I have no idea how to do it (I'm tempted to just write the MySql-specific syntax us...
Let's say you were crazy enough to want to try to combine a number of different technologies just to show that you could do so - what kind of app would lend itself to this type of project as a demo for a potential employer?
Specifically I'm thinking of combining the following technologies:
PHP/Django/Rails/Flex
Does this sound ridicu...
I've recently switched from storing session data in a cookie to storing it in the database.
Now every POST request causes an ActionController::InvalidAuthenticityToken error. It only happens in Firefox, and only on my home machine (I tried it out at work today in the same version of FF and everything was fine). This leads me to believ...
I almost never hear the word CakePHP without hearing the word Rails shortly afterwards. Are these two frameworks mainly similar based on how they adhere to the MVC model or do they have other significant similarities/differences?
One of the main attractions of Rails for me is how easy it is to do Ajax. Would that also be true of CakePH...
There may be situations where I would need to find an object by parameters other than ID. What is the proper RESTful way to do that?
For example I might want to find a User by username and password, so the strictly RESTful "GET /users/1" wouldn't work.
According to the Rails docs this is the URL pattern for getting all the instances of...
Having the same problems as this post, except I don't think the solution is the same unfortunately.
I'm getting this error message:
Rails requires RubyGems >= 0.9.4. Please install RubyGems
when I run a script/runner job in Cron, but it works perfectly fine when I run it in a terminal on the same server.
The rails server also runs f...
Hi. I've got a simple calendar displaying some events, that's not quite giving me the expected results. Here's the code:
<!-- Begin Calendar -->
<%= calendar(:year => @year, :month => @month, :first_day_of_week => 1) do |d|
output = []
output << render_calendar_cell(d.mday)
if d.wday == 1
@garden.plants.collect do |p|...
Like with browser games. User constructs building, and a timer is set for a specific date/time to finish the construction and spawn the building.
I imagined having something like a deamon, but how would that work? To me it seems that spinning + polling is not the way to go. I looked at async_observer, but is that a good fit for somethin...
Some information on A/B split-testing:
http://startuplessonslearned.blogspot.com/2008/09/one-line-split-test-or-how-to-ab-all.html
http://www.37signals.com/svn/posts/1525-writing-decisions-headline-tests-on-the-highrise-signup-page
I could do this in a Rails app with a simple case or if statement in my views, but that gets to be a lo...
Say, I love Debian+mod_rails and run it on my laptop which is my development platform. Yet, I am deploying to a production server running Ubuntu+mod_rails.
Is it better in a long run if I install Ubuntu on my laptop or are the problems with deployment so miniscule I can go with whatever the hell I like on dev. machine?
Thanks.
...
I have a User class with reference to a Message class. The message class has a user_id (which is the sender) and a receiver_id. So in the User class I have
has_many :messages
has_many :messages, :foreign_key => "receiver_id"
and then in the Message class I have
belongs_to :user
The first relationship -- via user_id -- goes p...
I would like to implement the method User.calculate_hashed_password. I'm trying to use the Shoulda testing library which works with Rails's built-in testing tools, so an answer related to Test::Unit would be just as good as one related to Shoulda (I think).
I'm trying to figure out what I need to test and how I should test it. My initia...
Is there a library like Rails for Lua?
...
What is the best way to turn an average desktop PC into server for hosting a website using Ruby on Rails?
I am open to changing operating systems, buying parts if I need to, using whatever Database People recommend and any software.
Here are the approximate details of the computer:
The computer is an HP Desktop with 1.86GHz Duo Core...
I am creating a plugin which involves a controller, model & views. while i can move these files from the vendor/plugin directory to app/controllers, models & views respectively.
now i can run my controller & model just by copying them in lib folder of vendor/plugins/plugin_name/lib and they are directly accessible, but my views are not ...