similar to: creating a model registry

Displaying 20 results from an estimated 300 matches similar to: "creating a model registry"

2008 Feb 18
6
inheriting static/class methods with new prototype.js class creation
Hey all. I want something like this to work: var Foo = Class.create(); Foo.myStaticMethod = function(){alert("I''m a static method!")}; Foo.myStaticMethod(); // works var f = new Foo(); f.myStaticMethod(); // doesn''t work, but that''s good--I don''t want it to var Bar = Class.create(Foo); Bar.myStaticMethod(); // doesn''t work, undefined :(
2008 Mar 04
3
remote_form_for does not work with method = :get
It seems that remote_form_for does not work with method = :get since it does not change the prototype call. Is this a bug? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe
2008 Feb 23
3
Attachment_fu: how to remove images?
I just used attachment_fu for the first time, and it works quite well. I have a user-model, and each of them has_one :image (and the images belongs_to :user). I have a question on this though: how can i remove images? Whenever i set a new image for a user (a user who already has an image), then the table with images gets updated correctly, with the user_id column of the old image set to null, and
2009 Sep 24
5
Non-ActiveRecord based model being passed as string?
I have a model that looks like this (with various other methods) class HsdPair attr_accessor :hsd def initialize(hsd) @hsd = hsd @current_display = 0 @has_changed_flag = false end end After initializing this object in the controller @hsd_pairs = HsdPair.new(@job.hsd_pairs) using it in the view various times and in various ways, when I try to pass this object back to the
2008 Feb 22
12
DRY - in controller or model????
Hello. I''m trying to make clean efficient code and would like to find out if there is a "BEST" way to write code. I want this to run quickly and efficiently for my app. I''ve got a form that needs a select list created for new and edit functions. Same list. Do I do this in the controller and reference @list in the forms? def new @list = %w { apple orange banana }
2008 Feb 25
4
Using group in with find in an ActiveRecord appropriately
I''m playing around with the Practical Rails Projects code, and was attempting to make a change for graphing data differently using groupings. Basically the code went from: total_weight = @exercise.activities.collect {|e| e.repetitions * e.resistance} workout_dates = @exercise.activities.collect {|e| e.workout.date.to_s} To: total_weight =
2009 Aug 07
4
ActionController::UnknownAction (No action responded to 22.
I try to switch my application from Rails 2.2.2 to Rails 2.3.3. In namespace :admin I have a resource-based controller. See controller class Admin::OSystemsController < Admin::BaseController def index ....... end def edit ......... end def update .......... end end Resource is added to routes.rb like map.namespace :admin do |admin| ............ admin.resources :o_systems,
2009 Aug 06
18
Best Practices Question
Should models call action mailers, or should those calls always originate from controllers? For example, should user.forgot_password send the email, or should the user_controller.forgot_password? Just looking for some opinions... Thanks, Tom
2009 Oct 28
2
What's the simplest way to use ActiveResource in ruby (without rails)?
I would like to use this class in a standalone project, but I have been unsuccessful thus far. Also, how does this class exactly communicate with the web server? Thank you. class Person < ActiveResource::Base self.site = "http://localhost:3000/" end
2008 Feb 29
7
Moving pagination to the Model
I''m using will_paginate in a Post class method; [code]def self.list(page) paginate :per_page => 10, :page => page, :include => :user end[/code] I can happily use the method on my posts controller index action; [code] class PostsController < ApplicationController def index @posts = Post.list(params[:page]) respond_to do |format|
2008 Nov 20
1
My ignorance and Fuse (or glusterfs)
I have a very simple test setup of 2 servers each working as a glusterfs-server and glusterfs-client to the other in an afr capacity. The gluster-c and gluster-s both start up with no errors and are handshaking properly.. One one server, I get the expected behaviour: I touch a file in the export dir and it magically appears in the others mount point. On the other server however, the file
2006 May 01
5
Adding classes without script\generate
Can I add classes to a rails application manually i.e without using script generate Model/Controller? The reason I am asking, I added a class by putting it in the controller class. I can access the class and its method from command-line (irb), but when I try to instantiate it in another controller, I get "uninitialized constant" error. If I try using script\generate Model
2007 Jan 03
3
Self-referential habtm with condition is broken
Here''s a simplistic model class. class Person < ActiveRecord::Base has_and_belongs_to_many :relatives, :class_name => ''Person'', :join_table => ''relatives'', :foreign_key => ''from_id'', :association_foreign_key => ''to_id'' has_and_belongs_to_many :brothers, :class_name =>
2005 Jul 06
2
Samba LDAP timeout
Hello, I'm having trouble configuring an Ubuntu Hoary Samba server to use LDAP for authentication (the server is named "dixie"). I'm basing my configuration on another server here at work that connects just fine. When I try to just list samba shares on dixie with $ smbclient -L dixie -U faker It takes quite some time for the request to go through before failing. Looking at the
2008 Mar 19
2
nil-error
Hi all, I''ve got the error below in my backgroundrb_debug.log. I''ve tried to reproduce the error in the development environment, but the only way I can get the same thing is by calling ask_work with a bogus worker name. Calling it with the production code causes no error. Here''s an example of what the code calls: MiddleMan.ask_work(:worker => :agronomy_worker,
2006 Jan 31
4
broadvoice??
Does anyone have any useful contact information for Broadvoice? I've been unable to call Argentina from my Broadvoice line for almost a month now. Their techs keep telling me they're "looking into it" but I get no real information. I've had several other tickets open for almost 8 months now. I called their PR company this morning and apparently they dropped Broadvoice
2009 Sep 29
1
Using speex for gsm-efr coding
Hello, I would like to know please whether I can use Speex for Gsm-Efr coding? Best Regards, Ilan Borenshtein RT embedded engineer ASOCS Ltd E: ilan at asocstech.com T: +972 (0)3 9012090 Ext. 214 M: +972 (0)50 5745100 F: +972 (0)3 9032112 www.asocstech.com <http://www.asocstech.com> -------------- next part -------------- An HTML attachment was scrubbed... URL:
2008 Mar 08
9
Validation error handling on related models
I have 2 models, entity and client. Entity has_one client and client belongs_to entity. Entity has attributes name and legal_name. Entity also has an unique index on (lower(name)). The pKey for both is the conventional Rails id. Client has a fKey constraint on entity_id and is indexed in entity_id. In controllers/clients_controller.rb I have: # GET /clients/new # GET /clients/new.xml
2006 Dec 04
7
I need help to connect Postgres and Ruby on Rails Please.
Hello to everyone, I have a problem that is giving me a headache, and trying to do a project in Ruby on Rails and I need to connect with a Data Base that is en Postgres, the truth is that I didn’t think that it was so hard to connect a DB with postgres because I was working with Msyql and everything was easy. This are the thinks that I have install in my computer. 1. Debian GNU/Linux, kernel
2007 Jun 02
1
linksys wip300 firmware
Hello, Does anyone have access to version 1.00.07 of the Linksys WIP 300 firmware? The only version on their site at the moment is 1.00.09, which the phone refuses to load. Regards, Ilan