Textmate 'Go to symbol' equivalent for Vim
On Railcasts I have noticed a very interesting feature 'Go to symbol' window. It work like Command-T but shows available classes and methods in current file. How to get it in vim? ...
On Railcasts I have noticed a very interesting feature 'Go to symbol' window. It work like Command-T but shows available classes and methods in current file. How to get it in vim? ...
How do you eager load polymorphic has_many :through associations in Rails/ActiveRecord? Here's the base setup: class Post < ActiveRecord::Base has_many :categorizations, :as => :categorizable has_many :categories, :through => :categorizations end class Category < ActiveRecord::Base has_many :categorizations, :as => :category h...
We're using the OpenPGP gem (http://openpgp.rubyforge.org/) to PGP- encrypt an XML file for submission to a third-party for processing. The prob is that when encrypting, we get errors like the following: RangeError: 1502 out of char range from /Users/dev/.rvm/gems/ruby-1.8.7-p249@dev/gems/ openpgp-0.0.3/lib/openpgp/buffer.rb:1...
I'm wondering if this is a good idea or not, either way I'd like you guys opinion on how to best achieve this sort of messaging popup system I have in my app. Under some occasions I want to popup a lightbox for users when certain actions are triggered. I already have the lightbox working and opening when when my controller returns JS fo...
Hi, How can I code once and deploy on Windows, Mac, Web and Mobile? App Titanium does not deploy on the Web. Thanks ...
I'm building what I thought was a fairly simple recipe app while learning RoR. I've got a table for users, and a table for recipes, and a recipe_users table where a user is saving a list of recipes. The error I'm getting from rails is "uninitialized constant User::RecipeUser" My Models are as follows class User < ActiveRecord::Ba...
I've been trying to figure out how to consume a SOAP service in Rails using certs, but currently my question is much more basic. In other tutorials I've seen a bunch of references to a property file called "soap/property" I just don't understand what that is (a standard text properties file?) and where it goes (/lib/soap/property?) An...
I am trying to install the mysql2 gem via the Bundler, but it keeps dying with the following error: ** executing command /home/cc_rails/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rubygems/installer.rb:483:in 'rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError) /home/cc...
When I read that people run phusion as the web server, and they allocate x amounts of ram per instance, what does this mean? Instance of what? Isn't phusion the web server? Or are they running x instances of phusion, each on their own ports and round-robinning? ...
Is there way to update a record after something has been rendered without putting the code in my view? For example I'm displaying messages to my users, and after the messages have been displayed I want to update the read attribute to true. What would be the best practice for doing this? ...
Here is the chat submit form: #chat_form - remote_form_for :chat, :url=>{:controller => "chats", :action=> "new", :id=>@request.id }, :html => { :autocomplete => 'off' } do |f| = f.text_area "message_content", :rows=>5, :cols=>55, :autocomplete => "off" = f.submit(value = "Sayit!", :class => "submit small") chat#new....
How you will handle complicated web page where you must display one User account with a lot of relations (15+) The translation data is kept on separate tables (globalize2/3) so the queries rised to 30+. Putting the ACL and some logging and you will got 45+ queries sometimes 65+ I don't want to split the page on multiple screens all d...
I have been looking into rails file upload tools and the ones that seemed the most appealing and interesting to me were carrierwave and dragonfly. From looking around it seems like carrierwave takes the more traditional style where you can process the file on save whereas dragonfly is middleware so it allows you to process on the fly. ...
After utilizing the great trial and error for over an hour along with dozens of tutorials and blogs posting examples, I still cannot get the simple ajax functionality to work. Here is what is in my partial: <span id="friend"> <%= link_to_remote image_submit_tag("/images/add_as_friend.gif"), :url => {:controller => 'friends', :action ...
Making good progress on rails now, but hit a snag on heroku deployment. After committing to git and then doing git push heroku master, I've gotten an error twice in the heroku logs when I try and open /users/sign_up Started GET "/users/sign_up" for 12.123.234.345 at Mon Sep 20 14:39:05 -0700 2010 Processing by Devise::RegistrationsCon...
I have a relationship in my ActiveRecord based model that looks like: belongs_to :foo My model should always have foo defined in it for it to be valid. My question is, when using validates_presence of, which one is the appropriate one to use: validates_presence_of :foo or validates_presence_of :foo_id Assuming here of course, th...
I have an issue here where I'm trying to call a class method on an object that is not known... err, I'm not sure how to phrase this I'm getting the :resource from the URL, but I want to run find on it for a differnt param as well. How can I do something like: params[:resource].classify.find(params[:id]) I mean this won't work because...
Hello, I am building a new application in Rails 3 and want to implement a "Loading" message that is displayed when an ajax request is fired off and hidden when the response comes back. I would like to keep it DRY and only specify this functionality in one place, with the ability to override the functionality selectively (for instance, ...
I memcached (with Dalli client) some of my search results like.. def self.city_search city, per_page, page, order Rails.cache.fetch("#{city}_#{page}_#{order}") do Post.search(:include => [:poster, :category],:geo => location_lat_lng_radian(city), :with => {"@geodist" => 0.0..(Constants::PROXIMITY * Con...
In Rails 3, is there a built in method for seeing if a string is a valid IP address? If not, what is the easiest way to validate? ...