I've built out a fairly complex Rails (2.3.8) app with a lot of jQuery ajax requests. There is an occasional bug, which I have difficultly replicating, where a jQuery $.ajax({..}) request will request a page it shouldn't (like the dash page, which is never called with an ajax request)...
What ensures is absolutely madness. Incredibly st...
I have this piece of AJAX code (took from: http://badpopcorn.com/blog/2008/09/11/rails-observer-field/) that is present in many views (new.html.erb and edit.html.erb mostly). To avoid code duplication I pretend to make use of partials:
app/views/cities/_state_city_form.html.erb
<p> State:
<%= select(:state, :state_name, City.all(:sel...
I am trying to install RSPEC but after configuring RSPEC gem and RCOV when i try to run rcov user.rb , i get the following error:-
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- spec/example/configuration (MissingSourceFile)
Can anybody help?
...
when I generate a two word named controller, like FooBar rails creates a controller and path like foo_bar this is not pretty. I would like to have the paths at least be FooBar.
Possible? Suggestions?
...
I use authlogic to authenticate users. In my controllers I use current_user, defined (as documented) as follows:
def current_user_session
return @current_user_session if defined?(@current_user_session)
@current_user_session = UserSession.find
end
def current_user
return @current_user if defined?(@current_user)
@cur...
There is a module
require 'iconv'
module Escape
def escape(string)
return_value = Iconv.conv('ascii//translit//IGNORE', 'utf-8', string).to_s
end
end
It`s work in 1.8.7 but not in 1.9.1
The error message is "NameError (uninitialized constant Escape::Iconv)"
and the follow is work in 1.9.1,Why??????? (my rails is rails 3 in ...
Hello,
I am facing problems while parsing RSS feeds from different sites. I need to fetch url, title and image from the feeds, but all of the sites have different structure for their feeds. Is is possible to have a generic script to fetch content from feeds of any structure?
How do browsers/feed readers/Google Reader handle this situat...
I have a cricket based portal check here cricket scores
This site has near to millions pages.
But is it advisable to have a multiple sitemaps in the website or not?
if Yes, what Name shall we give for the second site map? sitemap2.xml does this work?
Some where in the blog i have read that each sitemap should not have more than 1000 l...
My question is if a developer only knows either Html5/Javascript frameworks/server side JS Framework or Ruby on Rails, which skill set will allow him to develop the best web apps or provide greater creativity on the web?
Regards
...
I want to update more then one partial using the ajax form_remote_for helper
Currently I use this code which can update only one partial
form_remote_for :hour, @hour, :url =>{:action => "manage" },:id =>'hoursForm',:update=>'hoursIndex' do |f
I will appreciate if someone can tell me how can I adjust the update parameter so it can upd...
Hello,I want to ask if i can use will_paginate plugin two times on one page? For example i have table with male users and table with female users on one page or in one view and I need paginate both tables. My question is what is the usual solution of this problem?
...
SQLite3::BusyException: database is locked: CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
I get the above error when I try to migrate a migration (written below)
class AddIndexEmailUniquenessToUsers < ActiveRecord::Migration
def self.up
add_index :users,:email,:unique => true
end
def self.down
remove_...
A Phusion Passenger error message isn't what I want my visitors to see if they landed on my site while I'm updating the back end.
So how do I get around this? Is my deployment process flawed from the start? or is there something I'm missing out?
Here's my process of deployment, so you get the picture:
commit new updates to a git rep...
I'm creating a simple XML API in Rails, and currently, when there's an error, it renders the standard HTML error pages in public/, e.g. error in /tests.xml causes rendering of public/404.html.
Is there a way to make it render public/404.xml instead?
...
Hello, I have a job model which has many attributes. I would like to use graphics to display the sum of some of these attributes. For that, I am using the following code in the javascript portion of the view which produces the graph:
<% for job in @daily_jobs %>
['<%= job.day %>',<%= job.walltime %>],
<% end %>
This returns ...
Rspec obviously hates me. I kinda hate him back.
#features/step_definitions/custom_steps.rb
Then /^I should see the link "([^\"]*)"$/ do |linked_text|
find_link(linked_text)
end
#link.feature
Then I should see the link "foo"
From terminal:
undefined method `find_link' for #<Cucumber::Rails::World:0x818e02e8> (NoMethodError)
./featu...
What should be the permission on rails app directory on apache server???
...
In the web, I'm building local file drag and drop upload to the server with the ruby on rails, dragging and drop a file working fine, but how to get the dragged file content in the controller with the drop event? I'm getting the file with event.datatransfer, send file through Javascript with XMLHttpRequest.
function handleDrop(event)...
Poking around in the rails code, I ran across with_scope.
From what I can tell, it takes the scope type and conditions, merges them into existing conditions for that scope type, yields to the block, then gets rid of the additional scope.
So my first thought is in a multithreaded environment (like jruby on rails), what happens if while...
Hi,
I'm currently using Authlogic to handle all user accounts, but our company has switched over to Google apps and I would much rather use that same authentication for all users.
My question is - how?
I know I'll need the ruby-openid gem but I have yet to integrate authentication with a 3rd party. Any recent examples or tutorials out...