Hello, I'm trying to remove the object with the oldest updated_at value when the rjs is executed.
page.insert_html :top, :messages, :partial => @message
page[@message].visual_effect :grow
page[:message_form].reset
Message.old_messages.each do |m|
page.remove(m.id)
end
page.delay(1) do
page.select('.message').last.visual_effect :fad...
I am writing to log/delayed_job.log from within a perform method:
class MyWorker
def perform
logger.error("testing logger")
end
end
In log/delayed_job.log my error message is printed but without any formatting (prefixed with the date/time) compared to the other messages logged by delayed_job:
2010-03-10T14:46:18-0400:...
I'm not even sure I'm using the right terminology, whether this is actually bots or not. I didn't want to use the word 'spam' because it's not like I have comments or posts that are being created/spammed. It looks more like something is making the same repeated request to my domain, which is what made me think it was some kind of bot.
I...
For cruft-removal purposes I would like to log whenever a method from one of my AR models is called.
I can get get all those classes with something like this:
subclasses = [] ; ObjectSpace.each_object(Module) {|m| subclasses << m if m.ancestors.include? ActiveRecord::Base } ; subclasses.map(&:name)
But then I need a list of only the ...
hello,
I am changing the locale in the app controller
before_filter :set_locale
def set_locale
I18n.locale = params[:hl] || I18n.default_locale
end
for a Page that contains rendered partials and has a layout which yields the menu items.
The static text from the Page is translated to the new locale, however the static text from t...
I have two Rails applications, let's call them A and B. A has existing user base and i want these users to be able to log in to B with the username and password managed in A.
B is altered version of Altered Beast forum and it would be nice if users of my application do not have to create another user account to use forum. My initial tho...
Hi
Where I have a search which has a category (foreign key) and optional text, should I use thinking sphinx to "search" where a search string has not been submitted, solely the category?
...
Hi all,
I'm getting this occacional error from my rails app:
ActionController::MethodNotAllowed: Only get, put, and delete requests are allowed.
I think it's caused by a malformed HTTP request (in this case a DELETE request) caused by the client browser... Maybe?
The URL that triggers this action it's like:
https://domain.com/resour...
I am running a EC2 small instance as my production server. It has 1.7G memory. I noticed it uses almost all memory. However when I check top output, it looks like that only 30% is actually used. Did I misread the top output?
Here is the top output (sorted by %MEM)
top - 21:33:15 up 141 days, 9:39, 2 users, load average: 0.00, 0.00,...
I'm pulling data from Harvest. Here are my two models and schema:
# schema
create_table "clients", :force => true do |t|
t.string "name"
t.integer "harvest_id"
end
create_table "projects", :force => true do |t|
t.string "name"
t.integer "client_id"
t.integer "harvest_id"
end
# Client.rb
has_many :projects, :for...
I have the following one to many associations. Document has many Sections and Section has many Items.
class Document < ActiveRecord::Base
has_many :document_sections, :dependent => :destroy, :autosave => true
has_many :document_items, :through => :document_sections
end
class DocumentSection < ActiveRecord::Base
belongs_to :docume...
I have a JavaScript-heavy Rails app which I am testing in watir. I have two specific testing requirements:
I need to be able to simulate moving the mouse to a specific area of the screen (or at least triggering the onmouseover event for a div)
Evaluating a snippet of JavaScript once the above has happened to see if a flag is set correc...
I know Rails has a one_to_many relationship, but I want to enforce that "many" is at least one object. What's the most elegant way to do this?
...
I have two tables in a MySql DB:
items
id (char)
name (varchar)
description (varchar)
modified_at (datetime)
folders
id (int)
name (varchar)
parent_id (int)
From a query against a search index I get back an ordered list of ids for items and folders that matched the query. For example, ("ph76gjd", 34, "rh75ghd", "gr45gfd"). O...
Here is my chunk of code:
var update_shipping_methods = function(methods) {
$(methods).each( function(i) {
$('div$methods img#shipping_loader').remove();
var p = document.createElement('p');
var s = this.name + ' ' + this.rate;
var i = $(document.createElement('input'))
.attr('id', this.id)
.attr('type', 'r...
Update II Problem Solved but Why? This has been the biggest headache ever. My problem is solved, however I have no clue how I accomplished this task. Plus the following results make no sense. My .profile path (/usr/local/bin) is different than the path that is currently working (/usr/bin/). The working path suddenly appeared after I clos...
I have two models -- User and Entry -- that are related through a has_many relationship (a User has many Entries). I'm using RESTful routing, and have the following in my routes.rb file:
map.resource :user, :controller => "users" do |user|
user.resources :entries
end
This seems to work, but in my partial _form file, when I do this:...
I'm working through some inital setup of a dev environment for Facebook trying to use Facebooker and its SSH tunnel to expose my dev site. I’m having a lot of trouble with the SSH tunnel. I’ve made sure port 4007 is open and my SSH config contains both GatewayPorts yes and GatewayPorts clientspecified.
I can connect to the tunnel OK on ...
When I visit my Rails 2.2 app on my remote server I receive the following value as my REMOTE_ADDR.
request.env['REMOTE_ADDR']: "75.184.124.93, 10.194.95.79"
What has me stumped is why there are two IPs. A quick check of my currently leased public IP confirms that my IP is 75.184.124.93.
So where is 10.194.95.79 coming from?
Is there...
I'm trying to comprehend the Unix file system on my OSX. I'm following wikipedia Filesystem Hierarchy Standard.
I understand when I install ruby gems I must use the command sudo gem install but if I omit sudo, problems may occur.
Where are gems installed within the file system when I omit sudo?
How can I delete these gems?
A Fun side ...