From ironald at gmail.com Tue Nov 6 04:26:34 2007 From: ironald at gmail.com (Ronald Evangelista) Date: Tue, 6 Nov 2007 01:26:34 -0800 Subject: help on helper module inclusion/extension Message-ID: I want to include helper methods included to my Camping App from by requiring an external file but I can't seem to include helpers from another module. module CampingHelpers def self.included(base) base::Helpers.send(:include, Helpers) end module Helpers def show_test p "test" end end end Camping.goes :CampingApp ... module CampingApp::Helpers include CampingHelpers end ... the show_test method doesn't get included at all. is it because of camping eval'ling to S. any help would be appreciated. thanks! -- |^^^^^^^^^^^^\ .|| |NALDEVNGELSTA.___||'""|""\___, | ________________ l | |__|__|_|) (@!)!(@)"""""**|(@) (@)****|(@) (?`'?.?(?`'?.?(?`'?.? . Have a Terrific Day! .?'??)?.?'??)?.?'??)?.? From ruby at schmidtwisser.de Tue Nov 6 06:55:59 2007 From: ruby at schmidtwisser.de (Gregor Schmidt) Date: Tue, 6 Nov 2007 12:55:59 +0100 Subject: help on helper module inclusion/extension In-Reply-To: References: Message-ID: <2a50c7540711060355n5bca8278m8bae0577b715d647@mail.gmail.com> Hallo Ronald, I observed the same problems. The only solution I could make up is adding the methods in the included hook. Not pretty, but it works module MyHelperModule def self.included(base) base.const_get(:Helpers).class_eval do def pre_code(value) self.pre do self.code(value) end end end end end and then include MyHelperModule in your Camping app Camping.goes :Wild module Wild include MyHelperModule end If there is a more elegant solution out there, I will be happy to hear it. Cheers, Gregor On Nov 6, 2007 10:26 AM, Ronald Evangelista wrote: > I want to include helper methods included to my Camping App from by > requiring an external file but I can't seem to include helpers from > another module. > > module CampingHelpers > def self.included(base) > base::Helpers.send(:include, Helpers) > end > module Helpers > def show_test > p "test" > end > end > end > > Camping.goes :CampingApp > ... > module CampingApp::Helpers > include CampingHelpers > end > ... > the show_test method doesn't get included at all. > is it because of camping eval'ling to S. > > any help would be appreciated. > thanks! > > > -- > |^^^^^^^^^^^^\ .|| > |NALDEVNGELSTA.___||'""|""\___, > | ________________ l | |__|__|_|) > (@!)!(@)"""""**|(@) (@)****|(@) > > (?`'?.?(?`'?.?(?`'?.? . Have a Terrific Day! .?'??)?.?'??)?.?'??)?.? > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list > From why at whytheluckystiff.net Tue Nov 6 09:47:38 2007 From: why at whytheluckystiff.net (why the lucky stiff) Date: Tue, 6 Nov 2007 08:47:38 -0600 Subject: help on helper module inclusion/extension In-Reply-To: References: Message-ID: <20071106144738.GC47276@beekeeper.hobix.com> On Tue, Nov 06, 2007 at 01:26:34AM -0800, Ronald Evangelista wrote: > I want to include helper methods included to my Camping App from by > requiring an external file but I can't seem to include helpers from > another module. Try mixing into CampApp::Mab class directly, which will add methods to the Markaby class. class CampApp::Mab include CampingHelpers end If you want mixed-in methods to be used in controllers, mix into CampApp module. _why From Daniel.Berger at qwest.com Tue Nov 6 11:42:42 2007 From: Daniel.Berger at qwest.com (Berger, Daniel) Date: Tue, 6 Nov 2007 10:42:42 -0600 Subject: textarea fails on rows attribute Message-ID: <7524A45A1A5B264FA4809E2156496CFBE72F81@ITOMAE2KM01.AD.QINTRA.COM> Hi, Camping 1.5.180 Ruby 1.8.6 It looks like Camping is choking on the 'rows' attribute for input tags: input(:name => 'cuid', :type => 'text', :size => 10, :rows => 3) That will fail with: Markaby::InvalidXhtmlError no attribute `rows' on input elements: c:/ruby/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/builder.rb:143:in `tag!' c:/ruby/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/builder.rb:140:in `each' c:/ruby/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/builder.rb:140:in `tag!' (eval):92:in `tag!' c:/ruby/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/builder.rb:217:in `html_tag' (eval):3:in `input' C:/Documents and Settings/djberge/workspace/cluri/cluri.rb:118:in `index' c:/ruby/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/builder.rb:123:in `instance_eval' c:/ruby/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/builder.rb:123:in `capture' c:/ruby/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/builder.rb:155:in `tag!' (eval):92:in `tag!' c:/ruby/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/builder.rb:217:in `html_tag' (eval):3:in `form' C:/Documents and Settings/djberge/workspace/cluri/cluri.rb:108:in `index' c:/ruby/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/builder.rb:123:in `instance_eval' c:/ruby/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/builder.rb:123:in `capture' c:/ruby/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/builder.rb:155:in `tag!' (eval):92:in `tag!' c:/ruby/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/builder.rb:211:in `html_tag' c:/ruby/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/cssproxy.rb:43:in `call' c:/ruby/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/cssproxy.rb:43:in `method_missing' C:/Documents and Settings/djberge/workspace/cluri/cluri.rb:105:in `index' (eval):11:in `send' (eval):11:in `method_missing' c:/ruby/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/builder.rb:123:in `instance_eval' c:/ruby/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/builder.rb:123:in `capture' (eval):11:in `method_missing' C:/Documents and Settings/djberge/workspace/cluri/cluri.rb:27:in `get' (eval):27:in `send' (eval):27:in `service' c:/ruby/lib/ruby/gems/1.8/gems/camping-1.5.180/lib/camping/session.rb:11 2:in `service' (eval):46:in `run' c:/ruby/lib/ruby/gems/1.8/gems/camping-1.5.180/lib/camping/reloader.rb:1 17:in `run' c:/ruby/lib/ruby/gems/1.8/gems/camping-1.5.180/lib/camping/webrick.rb:45 :in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' c:/ruby/lib/ruby/gems/1.8/gems/camping-1.5.180/bin/camping:244 c:/ruby/bin/camping:16:in `load' c:/ruby/bin/camping:16 I'll try using the Markaby objects directly in the meantime. Regards, Dan This communication is the property of Qwest and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments. From joshua.schairbaum at gmail.com Tue Nov 6 12:00:25 2007 From: joshua.schairbaum at gmail.com (Joshua Schairbaum) Date: Tue, 6 Nov 2007 12:00:25 -0500 Subject: textarea fails on rows attribute In-Reply-To: <7524A45A1A5B264FA4809E2156496CFBE72F81@ITOMAE2KM01.AD.QINTRA.COM> References: <7524A45A1A5B264FA4809E2156496CFBE72F81@ITOMAE2KM01.AD.QINTRA.COM> Message-ID: <666E5011-C94D-4671-B6CB-22EC84CF3352@gmail.com> Daniel, I believe you want to create a textarea tag, not an input tag. Then you should be able to give it a rows attribute. Josh On Nov 6, 2007, at 11:42 AM, Berger, Daniel wrote: > Hi, > > Camping 1.5.180 > Ruby 1.8.6 > > It looks like Camping is choking on the 'rows' attribute for input > tags: > > input(:name => 'cuid', :type => 'text', :size => 10, :rows => 3) > > That will fail with: > > Markaby::InvalidXhtmlError no attribute `rows' on input elements: > c:/ruby/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/builder.rb: > 143:in > `tag!' > c:/ruby/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/builder.rb: > 140:in > `each' > c:/ruby/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/builder.rb: > 140:in > `tag!' > (eval):92:in `tag!' > c:/ruby/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/builder.rb: > 217:in > `html_tag' > (eval):3:in `input' > C:/Documents and Settings/djberge/workspace/cluri/cluri.rb:118:in > `index' > c:/ruby/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/builder.rb: > 123:in > `instance_eval' > c:/ruby/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/builder.rb: > 123:in > `capture' > c:/ruby/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/builder.rb: > 155:in > `tag!' > (eval):92:in `tag!' > c:/ruby/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/builder.rb: > 217:in > `html_tag' > (eval):3:in `form' > C:/Documents and Settings/djberge/workspace/cluri/cluri.rb:108:in > `index' > c:/ruby/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/builder.rb: > 123:in > `instance_eval' > c:/ruby/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/builder.rb: > 123:in > `capture' > c:/ruby/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/builder.rb: > 155:in > `tag!' > (eval):92:in `tag!' > c:/ruby/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/builder.rb: > 211:in > `html_tag' > c:/ruby/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/cssproxy.rb: > 43:in > `call' > c:/ruby/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/cssproxy.rb: > 43:in > `method_missing' > C:/Documents and Settings/djberge/workspace/cluri/cluri.rb:105:in > `index' > (eval):11:in `send' > (eval):11:in `method_missing' > c:/ruby/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/builder.rb: > 123:in > `instance_eval' > c:/ruby/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/builder.rb: > 123:in > `capture' > (eval):11:in `method_missing' > C:/Documents and Settings/djberge/workspace/cluri/cluri.rb:27:in `get' > (eval):27:in `send' > (eval):27:in `service' > c:/ruby/lib/ruby/gems/1.8/gems/camping-1.5.180/lib/camping/ > session.rb:11 > 2:in `service' > (eval):46:in `run' > c:/ruby/lib/ruby/gems/1.8/gems/camping-1.5.180/lib/camping/ > reloader.rb:1 > 17:in `run' > c:/ruby/lib/ruby/gems/1.8/gems/camping-1.5.180/lib/camping/ > webrick.rb:45 > :in `service' > c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' > c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' > c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' > c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start' > c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' > c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start' > c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' > c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start' > c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' > c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start' > c:/ruby/lib/ruby/gems/1.8/gems/camping-1.5.180/bin/camping:244 > c:/ruby/bin/camping:16:in `load' > c:/ruby/bin/camping:16 > > I'll try using the Markaby objects directly in the meantime. > > Regards, > > Dan > > > This communication is the property of Qwest and may contain > confidential or > privileged information. Unauthorized use of this communication is > strictly > prohibited and may be unlawful. If you have received this > communication > in error, please immediately notify the sender by reply e-mail and > destroy > all copies of the communication and any attachments. > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list From paul at rouge-robot.com Tue Nov 6 11:55:05 2007 From: paul at rouge-robot.com (Paul Thompson) Date: Tue, 6 Nov 2007 08:55:05 -0800 Subject: textarea fails on rows attribute In-Reply-To: <7524A45A1A5B264FA4809E2156496CFBE72F81@ITOMAE2KM01.AD.QINTRA.COM> References: <7524A45A1A5B264FA4809E2156496CFBE72F81@ITOMAE2KM01.AD.QINTRA.COM> Message-ID: <20071106165505.GA2270@rouge-robot.com> If you want a textarea why not do this instead: textarea :name => 'cuid', :rows => 3, :cols => 10 Paul On Tue, Nov 06, 2007 at 10:42:42AM -0600, Berger, Daniel wrote: > Hi, > > Camping 1.5.180 > Ruby 1.8.6 > > It looks like Camping is choking on the 'rows' attribute for input tags: > > input(:name => 'cuid', :type => 'text', :size => 10, :rows => 3) > From paul at rouge-robot.com Tue Nov 6 11:58:29 2007 From: paul at rouge-robot.com (Paul Thompson) Date: Tue, 6 Nov 2007 08:58:29 -0800 Subject: textarea fails on rows attribute In-Reply-To: <7524A45A1A5B264FA4809E2156496CFBE72F81@ITOMAE2KM01.AD.QINTRA.COM> References: <7524A45A1A5B264FA4809E2156496CFBE72F81@ITOMAE2KM01.AD.QINTRA.COM> Message-ID: <20071106165829.GA2312@rouge-robot.com> If you want a textarea use the following: textarea :name => 'cdid', :cols => 20, :rows => 10 Paul From zimbatm at oree.ch Tue Nov 6 12:13:05 2007 From: zimbatm at oree.ch (Jonas Pfenniger) Date: Tue, 6 Nov 2007 18:13:05 +0100 Subject: textarea fails on rows attribute In-Reply-To: <7524A45A1A5B264FA4809E2156496CFBE72F81@ITOMAE2KM01.AD.QINTRA.COM> References: <7524A45A1A5B264FA4809E2156496CFBE72F81@ITOMAE2KM01.AD.QINTRA.COM> Message-ID: Hi Daniel, Markaby throws an exception on malformed html entities to ensure valid HTML. The tag doesn't accept that "rows" attribute because it is not set in the standard (or am I wrong?). I don't remember where but I think that it is possible to disable those checks if you want but I thinkt that you're looking for the