I have a rails application which uses the restful_authentication plugin. I have activated the "remember me" functionality but every now and then I am getting logged out. The problem is I can't see the pattern for when it happens.
Sometimes it works in the development environment but not in production. Sometimes it works in Firefox but ...
I've a AJAX call, that pulls some initial data. Based on this data, I want to fire a series of AJAX calls, updating different parts of the page. It can be done using JS, with the XMLHttpRequest and onreadystatechange, checking for the status. If the first call is done and the response is 200, I can just fire a series of AJAX calls.
H...
I'm using link_to_remote to update a div asynchronously, but it does not work. I have to refresh the page in order to see the change.
I use this to generate the links.
http://ruby.pastebin.com/m1d83be81
"padding-left:30px", :display => "table-row" ) do %>
{ :success => 'entry_' + entry.id.to_s},
:url =>{ :controller =>...
When dealing with any framework with which you are not 100% familiar, I've found it advisable to attempt to understand and clean up any extraneous warnings, if only so that you have a better chance of noticing real errors when they occur.
The one I've been getting lately has been:
DEPRECATION WARNING: @model will not longer be implici...
I'm trying to test some environment-specific settings (middleware to be specific, but it doesn't seem to matter), but I'm having trouble getting the tests to run in the correct environment. The symptoms:
If I run ruby test/unit/my_test.rb, all is fine because the first thing it does is require test/test_helper.rb, which sets the enviro...
In the rails development environment, cache_classes is off so you can modify code under app/ and see changes without restarting the server.
In all environments, though, middleware is only created once. So if I have middleware like this:
class MyMiddleware
def initialize(app)
@app = app
end
def call(env)
env['model'] = M...
All Rails expert sites say not to store ActiveRecords in the Session. However, I have a multiple-field ActiveRecord object that spans several pages. The code I'm trying to clean up used hidden fields to pass the data forward, which seems like a bad idea (user can tamper for one thing). What's the typical, or good, way to divide up a mode...
Is there a built in way to convert special characters in rails from ASCII to html?
I saw 'htmlentities' but saw it is form a while back and wondered if there was anything more generic lately?
...
I upgraded to Snow Leopard using the disc we got at WWDC.
Trying to run some of my rails apps now complains about sql
(in /Users/coneybeare/Projects/Ambiance/ambiance-server)
!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql.
Importing all sounds in /Users...
Having issues with a rails 2.2.2 app running on a VPS (Ubuntu 8.10): looking for github repos, posts, anything that covers the right way of setting up email processing. For example, should it be using sendmail or smtp?
...
In the course of building a rails application to help small hotels' manage bookings, I'm encountering a strange application hang. Building the reservation works fine; adding guests, assigning them to rooms, etc, without issue. However, when the merchant goes to 'confirm' an inquiry, Mongrel hangs me out to dry.
The index page for reserv...
I've currently created a custom rake file that does the following:
1.) Checks an External Feed for "NEW" Items
2.) For each new item in the feed array,it updates my Database with a new record
3.) I've currently got it on a WHILE loop. The while loop has an (@loopcheck) instance variable that is set to true initially, and if any ex...
If I want to check passwords in my application for the inclusion of English words, should I store a database of English words locally (is there a free database?) or is there a (free) web service I can use to check them remotely?
Ideally I would check the words using an Ajax call but I don't want to pass the entire English dictionary by...
Hi,
I am trying to use i18n in rails. I want the language to be set first from params[:locale] (probably already in the url) then from the browser http header and lastly from the default_locale. Everything is fine. Now the problem starts, when I want to add a dropdown list to allow the user to change the locale. How do I force the page t...
I have no idea how I would set up a BerkelyDB database in a Ruby or Rails project.
Does anyone have any experience configuring one, that they could talk about?
Maybe using ActiveRecord or Datamapper?
...
I've set up a Rails form roughly following the instructions in this Railscast.
Here's the code for the form:
<% form_tag complete_todos_path, :method => :put do %>
<ul>
<div id="incomplete_todos">
<% @incomplete_todos.each do |todo| %>
<%= render :partial => todo %>
<% end %>
</div>
</ul>
<%= submit_tag...
Hi All,
I'm currently developing a Rails app with 4 nested models (as per THIS POST). I've considered using javascript to manage them all on one page. It appears doable (as do many things in Rails), however, it doesn't come highly recommended.
That said, I'm looking to manage via proxy pages. Currently the model structure is as foll...
Suppose I have a standard Post.first.created_at datetime. Can I compare that directly with a datetime in the format "2009-06-03 16:57:45.608000 -04:00" by doing something like:
Post.first.created_at > Time.parse("2009-06-03 16:57:45.608000 -04:00")
Edit: Both fields are datetimes, not dates.
...
I think that the SO-style tag system works very well and would like to emulate it in an app I am building with Rails. I am especially enamored by the way the tag entry box looks up the top 5 tag matches as you type. Is there a built-in function or plug-in that would do something similar for me in Rails? Otherwise, what would be a good...
I have a typical artist has_many songs model and I'm trying to set up the nested resource in Rails.
My routes.rb looks like this:
map.resources :artists do |artist|
map.resources :songs
end
This works fine for the artist paths, but when I want to link to the songs controller, like this:
<%= link_to artist.name, artist_songs_path(...