similar to: Localization using inheritance

Displaying 20 results from an estimated 30000 matches similar to: "Localization using inheritance"

2006 Jul 18
4
Multiple Layouts - Single Controller
How do I do multiple layouts for a single controller: I am aware I can do... render(:layout =>''mylayout'') for individual actions, however this becomes a multiple render problem. I tried this... layout "mylayout", :except => [:myaction, :myotheraction] layout "myotherlayout", :only => [:myaction, :myotheraction] However that doesn''t
2005 Sep 25
1
Prototype "classes" and inheritance
JavaScript doesn''t (yet) have a notion of classes. Prototype.js just adds a suitable convention for implementing them. It provides a way to create a new class by extending a base class using Object.extend, but it doesn''t handle method inheritance. There are ways of doing implementing this through traversing the chain of prototypes, but I''m not sure they are
2006 Jul 06
6
Class variables in templates/layouts
I''m having problems with class variables.. I have a class: class Content::ApplicantsController < ApplicationController layout "mylayout" @@tab = "mystring" [... the rest is standard scaffold-created stuff ...] and a layout (mylayout.rhtml): [...] <title><%= @@tab.capitalize %></title> [...] And I keep getting this error: uninitialized
2006 Feb 23
3
has_many: inserting children when inserting parent
disclaimer: am in the midst of my first ruby/rails project I have a situation where I want several child records to be created when a new parent record is created. The following represents my first stab at coding it, am I on the right track? Here is the model: parents ---------- id name children ---------- id parent_id name class Parent < ActiveRecord::Base has_many: children end
2010 May 21
0
Authlogic and Single table inheritance
Hi, I have some models such as: class User < ActiveRecord::Base acts_as_authentic end class Admin < User end class Superadmin < Admin end And some controllers such as: class UserSessionsController < ApplicationController def new @user_session = UserSession.new end def create @user_session =
2006 Jul 13
5
ActiveRecord inheritance
How to create a super class based on ActiveRecord::Base? For example: class ParentRecord < ActiveRecord::Base end class ChildRecord < ParentRecord end Rails always asks for ''parent_records'' table. Which has absolutely no need to exist at all. It''s intentionally made as a super class to be inherited. Thanks. -- Posted via http://www.ruby-forum.com/.
2006 Mar 05
8
Model Inheritance, Mixins and Database design
I''m trying to understand how best to use inheritance and wonder if Rail''s Single Table Inheritance model too restricting. I have a model Companies who provide 1+ Services (HABTM relationship). I assume the best way to represent this is with a series of child models representing each type of service : ServiceType < Company. I want to return lists of companys for each
2006 Mar 08
2
inheritance problem with controllers
i have a controller like this: class SpoilageController < DataEntryController before_filter { check_access_key(''_SP'') } ... and in the parent class is this: class DataEntryController < ApplicationController def check_access_key(key) if !@session[:user].admin && !@session[:user].data_entry_access.to_s.upcase.include?(key) render
2009 Jul 16
0
[PATCH server] add network QMF apis. (still in progress)
This isn't yet functional, but I'm submitting the patch so Ian can continue work on it. Signed-off-by: Scott Seago <sseago at redhat.com> --- .../lib/ovirt/controllers/network_controller.rb | 26 ++++++++++++++++++++ .../physical_network_impl_controller.rb | 10 +++++++ .../lib/ovirt/controllers/vlan_impl_controller.rb | 9 +++++++
2006 Dec 11
0
auth_generator 2.0.1 undefined method `login_required' for ... ArticlesController
I am a relative RubNub and attempting to implement auth_generator v.2.0.1. I am getting an "undefined method `login_required'' for #<ArticlesController:0xb732c0b4>" error when I attempt... http://localhost:3000/articles/new Help would be appreciated. My app/controllers/application.rb reads... ------------------------------------------------------------------------
2006 Jan 30
2
Modules, controllers and inheritance
Hi! I was trying to cleanup my app and I runned into quite a problem. My controllers in submodule do not seem to inherit things from base class. I have following setup: app/controllers/ application.rb: class ApplicationController admin/ admin_controller.rb: class Admin::AdminController < ApplicationController include LoginEngine include UserEngine
2006 Feb 28
0
Confusion with counter and single table inheritance
I''m having trouble getting the magical counter to work in a rails app with single table inheritance. following is the relevant code. thank you class declarations class Job < ActiveRecord::Base has_many :vents end class Vent < ActiveRecord::Base belongs_to :job, :counter_cache => true validates_numericality_of :width end class Rectangular < Vent
2007 Sep 29
8
Inheritance problem in model
Hello, I''ve got a problem with the inheritance as soon as I try to use it in a model. I''ve got plenty of items which can share a lot of code, so I created a class "Item", which inherits from ActiveRecord::Base, but because it''s not a "real item" but an interface, I set it abstract (writing abstract_class? method). Then I have all the differents
2005 May 23
1
SV: Documentation of S3 and S4 classes, inheritance
I am sure that I do not have the answer to your question - but I would like to add to your views regarding the S4-issue. I've been involved in the gRbase package for graphical modelling in R. The first version was implemented in S4 but now we have made a roll-back to using S3 methods. While, I can see that S3 is not really comprehensive enough for 'proper' object oriented
2009 Jul 06
0
[PATCH server] UI for accumulated uptime for VMs. (revised2)
This revised version of the patch incorporates jguiditta's sorting fix as well as some other changes required to make this work fully on the cloud UI side. --- src/app/controllers/pool_controller.rb | 2 +- src/app/controllers/resources_controller.rb | 4 +++- src/app/controllers/smart_pools_controller.rb | 7 +++---- src/app/helpers/application_helper.rb | 14
2019 Dec 09
4
CentOS website/blog localization support for IT (italian...) language
Hi guys, greetings from Italy. My name is Andrea Flori and I work in an IT company who give Linux support to his customers I am somehow involved with CentOS in the last 3 years (both for private/personal use and work) and I think that time is arrived to give some contribution to the project. In the last 3 years, I am somehow involved with CentOS (both for private/personal use and work) and I
2005 Sep 29
0
Single Table Inheritance and rhtml docs
Is there any way to wire the .rhtml files in app/views into Rails'' Single Table Inheritance mechanism? So given: class Bar < Foo The STI mechanism is generating the objects correctly when it hydrates them out of the db, but when it goes to rendering pages, it pulls everything from app/views/foo and doesn''t touch app/views/bar. I can of course hook in manual type-checking
2012 May 03
3
inheritance with rails.
Hello. I''ve read about examples on inheritance with rails. Here is an example: http://juixe.com/techknow/index.php/2006/06/03/rails-single-table-inheritance/ The way is to add a type field in the table. So if I have an Animal class with an attribute name, I can inherit from this class like: Dog < Animal, Cat < Animal, and so on. With the type field in the table I can do Dog.all,
2005 Nov 20
1
Just another localization thread
Hey all, I was playing w/ Thomas Fuch''s Localization module (thanks Thomas!), and just realized how hard is to localize an application in Rails :-) The Localization module works nice, but the problem is the error messages. Its not that good to keep the application in [your idiom] and the error messages in english. I saw the other threads about it, specially the ones that recommends
2009 Jul 06
2
[PATCH server] UI for accumulated uptime for VMs. (revised3)
This revised version of the patch incorporates jguiditta's sorting fix as well as some other changes required to make this work fully on the cloud UI side. --- src/app/controllers/pool_controller.rb | 2 +- src/app/controllers/resources_controller.rb | 4 +++- src/app/controllers/smart_pools_controller.rb | 7 +++---- src/app/helpers/application_helper.rb | 14