similar to: overriding constants

Displaying 20 results from an estimated 200 matches similar to: "overriding constants"

2006 Sep 04
1
Overriding ActionView::Helpers::InstanceTag::DEFAULT_TEXT_AREA_OPTIONS
What is the best way to override some of the FormHelper default options? Right now I''m adding this to the beginning of my environment.rb: ActionView::Helpers::InstanceTag::DEFAULT_TEXT_AREA_OPTIONS = { "cols" => 80, "rows" => 5 } Is that the way it''s supposed to be done? --~--~---------~--~----~------------~-------~--~----~ You received this message
2009 Mar 15
5
Setting DEFAULT_FIELD_OPTIONS in Rails 2.3
Hi, I''m having some trouble overriding/defining the default_field_options constant without raising a warning. I''ve tried adding the code to do it in an initializer but that produces a warning (because the constant is already frozen), after some googling I found a recommendation to put it in the environment.rb file but that then that throws uninitialized constant ActionView
2006 May 18
3
populating array of text_fields from an array of model objects
I have in my view the following: <% 0.upto(@num_performances) do |idx| -%> <%= text_field ''performance'', ''city'', :index => idx, %> <%= text_field ''performance'', ''venue'', :index => idx, %> <% end -%> and in my controller I have: @performance = [Performance.new("city" =>
2006 Mar 01
3
Form helpers and overloaded methods - help!
Can someone explain why form helpers appear to bypass any model methods I override for fields that are bound to database fields? It would be great if someone could tell me how to force the form field, etc to call the method instead of looking at the database / attributes collection. Let''s say I have a column called ''price'' in my database table "books"
2006 Jul 08
10
A rant about parameters
Guys, I''ve been chasing a problem with country_select for the past few hours now. My intention was pretty simple...use the following line in a form: <p><label for="country_region">Country</label> <%= f.country_select :country_region, "United States" %></p> However, for the life of me, I couldn''t get it to work. I kept getting
2006 May 18
2
attempt to override the ''tag'' method
I want to override the ''tag'' method in ActionView::Helpers::TagHelper to do some generalized error handling similar to the way scaffolding puts a red border around fields that fail validation. I''ve created a file lib/rails_patches/tag_helper.rb which contains the following. module ActionView module Helpers module TagHelper alias_method :orig_tag, :tag
2010 Jun 21
4
Failing Routes in deployment
I have an app that has the following in the routes file: namespace "admin" do # ADMINISTRATIVE ROUTES ONLY root :to => ''home#index'' resources :comments do member do get :approve get :reject end end resources :users do member do get :block get :unblock end end end When browing to
2006 Jul 24
2
InPlaceSelectEditor question
I''m attempting to use the example given in the Rails Recipes book chapter 2, to create a select drop-down using the InPlaceEditor function (modified to be InPlaceSelectEditor. The example given works (a country list drop-down), but I''m attempting to use it to display a list of items generated from an object in another table that is linked to the table that I''m editing.
2005 May 08
3
Overriding date_select in local project to use custom value rather than blank for starting option...
I would like to have a date control on a page and I would like a behavior similar to what you get using date_select with the :include_blank => true option where the first value in the dropdown is "- Month -", "- Day -", or "- Year -" rather than a blank value for the respective month, day, and year select fields. I took a look at the ruby source for
2006 Mar 20
1
FileColumn question
Can someone please help me with this. I have an Images table :- create table images ( id integer unsigned not null auto_increment primary key, image varchar(200) not null default '''' )ENGINE=InnoDB default CHARSET=latin1; And a car table :- create table cars ( id integer unsigned not null auto_increment primary key, user_id integer unsigned not null, title varchar(100) not
2007 Apr 09
4
How do i switch off error wrapping for a specific field?
Hi, i have some issues with the default rails error wrapping. It wraps errors in a div with class ''fieldsWithError'', which is not good practice in my eyes. Adding a class ''error'' to the field would be much nicer. My solution to the problem: build your own FormBuilder. Funny enough, i found no (nice) possibility to switch error wrapping off while using the
2007 Apr 18
1
Postgres-pr interface not found
I''ve installed the postgres-pr gem, and it is found using gem list v0.4.0. In my active record source, inside the postgresql_adapter.rb file, I''ve changed line 7 from: require_library_or_gem ''postgres'' unless self.class.const_defined?(:PGconn) to: require_library_or_gem ''postgres-pr'' unless self.class.const_defined?(:PGconn) ...to try and
2013 Feb 11
27
Certificate verify fails without indications
I have a puppet master on Centos 6.3 connected and working properly with other Centos 6.3 agent. I installed puppet agent via gems on a RED HAT 4 node. This is what happens when I try to sign certificate for the new node: AGENT [root@FP2 ~]$ puppet agent -t Info: Creating a new SSL key for fp2 Info: Caching certificate for ca Info: Creating a new SSL certificate request for fp2 Info:
2007 Feb 28
1
Rails 1.2 Bug (?): to_text_area_tag
Hi all, I''m fairly new to rails and thus might be missing something here, but I think I have found a but in ActionPack. If this is not the right place to post this, please let me know where. I discovered this issue while attempting to use the lastest edge version of ajax_scaffold (mooey, MUI, whatever it''s going to be called). I kept getting the error: private method
2006 Jul 02
1
DRY? Why select_date and select_date?
Why select_date and select_date? I dont understand why having both (backward compat?). I also look that their source are different, one use the InstanceTag and others calls 3 select_(year, month, day) functions.
2013 Apr 10
1
Per form field_error_proc
Hi everybody, I needed change field error rendering for some forms created with Rail''s form builder. I found solution by changing ActionView::Base::field_error_ proc to own before form and changing it back after form rendered. I don''t like this solution :) It''s not thread-safe (but it''s not so important, nobody really wants it :), but I don''t like
2010 Jul 30
1
[PATCH 1/2] Monkey-patch mongrel to fix rails 2.3.5 incompatibility
Signed-off-by: Nicolas Ochem <nicolas.ochem at alcatel-lucent.com> --- src/config/initializers/mongrel_patch.rb | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) create mode 100644 src/config/initializers/mongrel_patch.rb diff --git a/src/config/initializers/mongrel_patch.rb b/src/config/initializers/mongrel_patch.rb new file mode 100644 index 0000000..ae2bcf4 ---
2007 Oct 30
5
Using Standard Integration Tests with RSpec
Hi there. I am using RSpec for unit and functional testing on a project. I have however found the (experimental) RSpec stories to be un-intuitive in some situations. The RSpec plugins seems to disable the standard Rails Tests, so how could I go about usng Integration tests alongside Rspec? Thanks. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~
2014 Feb 12
61
P2V: Headless support
This introduces support to run P2V without X server. Runtime parameters are specified via kernel command line making it hopefully suitable for automated migration with a little help of PXE boot. Patchset is not squashed and represents dev. history.
2005 Dec 28
1
FCGI: warning: Object#id will be deprecated; use Object#object_id?
I am seeing some strange entries in my Apache error log from FCGI that I don''t understand. I have pasted one of the lines below. Anyone seen this or know what might be going on? [Wed Dec 28 08:35:50 2005] [error] [client 24.115.131.100] FastCGI: server "/home/www/apps/appname/public/dispatch.fcgi" stderr: /home/www/apps/appname/app/views/photo/fullsize.rhtml:26: warning: