Rails 3 equivalent for periodically_call_remote
Seems like periodically_call_remote is deprecated in Rails 3, any ideas how to achieve the same functionality? ...
Seems like periodically_call_remote is deprecated in Rails 3, any ideas how to achieve the same functionality? ...
I like the idea of separating functionality and this seems like the way of the future. But I'm used to integrating javascript inside loops in an embedded language like Rails ERB or PHP, where I can use the ID of a particular object as a reference in the javascript. Rails example: <% @comments.each do |comment| %> <div id="comment_<%...
I got uploadify to work properly with a model that I have without any authentication. The problem is, a user needs to be authenticated before s/he can upload a file. When I enable the before filter, the file doesn't get uploaded. before_filter :authenticate def authenticate authenticate_or_request_with_http_basic do |name, password| ...
For example: I want to create a new kind of tag (fancy_input_tag) for use from any view as a plugin. No problem, I can do this. The trick is my tag requires the use of stylesheets and javascripts. As usual, my rake task copies these assets into their appropriate public folders. Having built this plugin myself, there’s no real issu...
Consider the following scenario: You have an account model You have an external service which manages subscriptions (such as CheddarGetter). You do not want to create a customer on CG unless the data entered passed your own validations, and likewise you don't want to save the customer down to your own database unless CG accepts the cus...
config.gem: Unpacked gem authlogic-2.1.5 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this. config.gem: Unpacked gem authlogic-2.1.6 in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this. /disk1/home/slugs/283271_2d484fd_a21d/mnt/config/../vendor/rails/railties/lib/initiali...
I am using rvm, doing the following: rvm install ree <--- (Ruby Enterprise Edition), or this can be 1.8.7 or 1.9.2 rvm ree rvm gemset create 'proj' cd path/to/proj bundle install so Gemfile in that project says: gem 'rails', '3.0.0' and bundle install is super fast, reporting Using rails (3.0.0) but after that when I type $...
I have a Rails application with over 2,000 examples in my RSpec tests. Needless to say, it's a large application and there's a lot to be tested. Running these tests at this point is very inefficient and because it takes so long, we're almost at the point of being discouraged from writing them before pushing a new build. I added --profile...
I'm getting a very odd error when I attempt to access the find method of a has_many relationship. What am I doing wrong syntactically? # Instructor model class Instructor < ActiveRecord::Base has_many :events end # Event model class Event < ActiveRecord::Base belongs_to :instructor end # Controller snip-it i = Instructor.first co...
When I do just script/runner it gives me -bash: script/runner: Permission denied When I do sudo script/runner it gives me sudo: script/runner: command not found It only works when I do ruby script/runner. Why? Everywhere else I see people just run script/runner without the ruby in front of it... Is there a "fix" for this? It's causing ...
I am trying to include a custom validation across many models through a module, and I'm seeing some strange behavior. I wrote a custom validation called validates_as_unique which checks to see if a group of attributes is unique among records in the database. In a module called FactBehaviors I have: module FactBehaviors def self.includ...
Hi, I am writing a spec for the create method of a controller : describe "POST create" do it "should create an adtag with valid params" do campaign = Campaign.make campaign_attributes = Hash.new campaign_attributes[:adtag_attributes] = Hash.new campaign_attributes[:adtag_attributes][:code] = "<h1>Sample co...
Could you tell me how to add internationalization for select tags in formtastic? # view .... f.input :hair_colour, :as => :select, :collection => HAIR_COLOURS .... # user.rb class User << AR validates_inclusion_of :hair_colour, :in => [0..8] end # de.yml de: profile: hair_colour: 0: "Blond" 1: "Dunkelblond" ...
When I try to run tests from TextMate in Rails3 i get an error that I trace back to boot.rb. When I try to run boot.rb via textmate I get this error: LoadError: no such file to load — bundler method gem_original_require in custom_require.rb at line 31 method require in custom_require.rb at line 31 at top level in boot.rb at line 4 ...
So I'm implementing my first many-to-many relationship and I'm having some trouble getting the related collection to populate in my view For example: simple blog w/ posts and tags my post controller new action has this var @tags = Tag.all next inside my view I have the following loop <% for tag in @tags %> <input type="check...
For non-Rails work, regular Ruby works fine on my Windows 7 machine. But I'm about to start some Rails work that will use SQL Server as a database, and trying to get Rails set up has been a total pain so far. (I still can't get sqlite3 or SQL Server to work correctly with Rails yet.) So I'm wondering: will using IronRuby (which I haven...
I've looked at Liquid and the like, but I cannot find a way to make a "one file" template that can handle all situations. I don't want to reinvent the wheel, but I will if I cannot find an existing solution. The template system looks like this: {block:Text} <li class="post text"> {block:Title} <h3><a href="{Perm...
How is it possible to keep my rails application up to date using chef? While reading documentation I understood how to set up servers from scratch using knife bootstrap. But is it possible to run another tasks after this? Earlier I have used capistrano but now we have two staging and ten production servers which needs to be up to date ...
How can i use numbers in my yml files to show translations? f.e.: # de.yml profile: hair_colour: 0: "Blond" 1: "Dunkelblond" 2: "Braun" 3: "Brünett" 4: "Rot" 5: "Schwarz" 6: "Grau/meliert" 7: "Glatze" 8: "Andere" Its not working... Why? How can i fix this? ...
I have two tables: books (id, name, desc, instance_id) instances (id, domain) A user should ONLY be able to see data that is assigned to their instance_id in records... For the books, model, to accomplish this, I'm thinking about using a default scope.. Something like: class Books < ActiveRecord::Base attr_accessible :name, :des...