similar to: question about sessions and code re-use

Displaying 20 results from an estimated 100 matches similar to: "question about sessions and code re-use"

2007 Jan 17
0
question about code reuse and session variables
hey there, i have a simple model called key_words.rb the purpose of this is to hold system config data. it also holds the parameters that our system uses to judge the condition of the stuff we monitor. anyway, one of the methods is this def self.get_in_wet_list(status) wet_list = find(:first, :conditions => "name = ''wet_list'' ")
2006 Oct 22
3
Keeping DRY - I like a simple life!
Hi, I''m new to Ruby and Rails and I would be very grateful for some advice. I''ve got the following code. class Foo < ActiveRecord::Base include Versionable # Some methods to handle my versioned objects has_many :versions, :class_name => "FooVersion", :foreign_key => "parent_id" belongs_to :curr, :class_name => "FooVersion",
2006 Aug 10
1
acts_as_textiled
It''s nothing revolutionary. Just a plugin which lets you forget about the whole Textile to HTML render process. Once you tell your model which fields should acts_as_textiled (and as long as you''re using form_for for your text entry) it Just Works. No DB changes or whatnot. Here''s the skivvy: http://errtheblog.com/post/14 Tips and tricks in that post and README.
2007 May 27
3
Stripping out textile markup
Hi, I have several hundred pages of text, all carefully marked up with textile, which I use redcloth to convert to html for display. Now I find I need all these pages to alternatively output plain text - ie. A-Za-z0-9 and simple punctuation only. Any suggestions on the best way to do this? My only thought is to let redcloth do its stuff, and then strip out the html tags - but it feels wrong.
2007 Feb 26
2
undefined method ... from `alias_method'
0 wicked var/www % ./script/console Loading development environment. >> r = Recipe.find :first NameError: undefined method `recipe_type='' for class `Recipe'' from ./script/../config/../config/../app/models/recipe.rb: 101:in `alias_method'' In recipes_controller: alias_method :orig_recipe_type=, :recipe_type= def recipe_type=(t) if t.nil?
2006 Aug 13
3
+ migrations in camping
Camping apps are supposed to be little independent apps, often contained in a single file, which create the database tables and manage them without hassle. These days it''s common to see in a Camping app: module Tepee::Models def self.schema(&block) @@schema = block if block_given? @@schema end end Tepee::Models.schema do create_table :tepee_pages,
2006 Aug 10
6
Multiple sites using one data source
Hi, Just wondering if anyone has any suggestions as to the best way to provide access to the same data source for the (possible) creation of multiple web sites. I figure my options are: - Direct database access over tcp - ActionWebService - Wait for ActionResource I''ve done up some work with ActionWebService already, but I don''t think it''s going to work because it
2006 Aug 13
1
establish_connection method
I''m digging into rails source code. But I''ve got a problem in undestading actionrecord::base source code which is connection_specification.rb. In the body of establish_connection method, def self.establish_connection(spec = nil) case spec when nil raise AdapterNotSpecified unless defined? RAILS_ENV establish_connection(RAILS_ENV)
2007 Jan 16
1
Can't pass parameters to Ziya controller using url_for
Hi All, I''m stuck yet again. I have an action on a controller that produces a Ziya graph, which I call using the gen_chart() helper. However, I can''t seem to pass more than one parameter through to the action. <%= gen_chart( "overview_graph", url_for( :controller => ''graph'', :action => ''graph'', :graph_id =>
2010 Aug 09
6
configure question and passenger
Greetings all. I have seen a couple of diagrams on the net that look like a computer set up as an nginx server and more than one mongrel server running at once. What is the advantage of having more than one mongrel server running? Is there a good how-to that explains it very well. thanks shawn -- You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2006 Aug 15
1
Camping with Dr. Nic
Campers. Dr. Nic. The new migrations in Camping''s trunk are very nice. They also open the door (just an inch) to using Dr. Nic''s Magic Models with Camping. Here''s my stab at ''er: http://require.errtheblog.com/camping/blog.rb Run that against Camping trunk. Don''t forget to `sudo gem install dr_nic_magic_models`. The hackery is in
2006 Jul 21
1
RedirectHandler? mongrel_rewrite?
Hey guys. I''ve been playing with RedirectHandler and it''s pretty neat, but I question its usefulness. At work we do the trendy "/javascripts/spy.1152734636.js"-style asset includes rather than the default Rails style of "/javascripts/spy.js? 1152734636". This is no problem with mod_rewrite as we run the basic Apache => Pen => Mongrel setup.
2008 Mar 15
1
my keys to google maps api only work in webrick
Hey there all,. i am developing three sites that run on the same code, just different logos, different companies, etc.. i have a config file that i believe is how it should be and it works on webrick, but i get application errors when i try to move it to the apache FCGI . looks like this development: ABQIAAAA8GzGL0c5HitzfNKYM4nk_BQODDn4SSK1uiT7GyxROHR1XtTV_RTBQrvsTtfZDFeAH2vzkOtXunHV9g
2005 Jun 19
1
got a question
Hey there, cool product, my family and i are wanting to build a kids streaming educational radio station. This is the perfect thing for it. i did the install (Arch Linux) and apparently i am serving correctly. i built a test play list with four tracks into a file mystream.ogg.m3u when i go on my computer and go to localhost:8000/mystream.ogg.m3u everything works great. but when i go to the
2008 Mar 15
3
problem with config file
Hey there all if i have this in my gmap_api_key.yml file, production: ABQIAAAASPzYuwhUCPD9Vz98LPOPDhQXfahRKLczKzlJSy9lXc0oaHHYcxTFTjWleXY7LH-N3IAp9ruoqiU43w everything works fine but if i have this ..... production: texaspivot.com: ABQIAAAASPzYuwhUCPD9Vz98LPOPDhQXfahRKLczKzlJSy9lXc0oaHHYcxTFTjWleXY7LH-N3IAp9ruoqiU43w i get this ActionView::TemplateError (texaspivot.com) on line #1 of
2007 Mar 19
24
alias method spec?
I am completely baffled by this one - My guess is that there is no pure ruby way to do this - but how could I set up a spec to test that one method is an alias of another? Thanks for any help, Scott
2006 Jun 30
50
Time To Pick the Mongrel BUGS Mascot!
Bradley Taylor shot me this *goldmine* of ugly ugly ugly dogs: http://www.sonoma-marinfair.org/uglydogvote.shtml I *have* to use one of these for the Mongrel BUGS Mascot. He''ll go on our bug list page and replace the little beetles on the left. Pick the dog you think best represents a lovable but defective pooch and reply to this with your +1. Let the voting begin! -- Zed A. Shaw
2006 Nov 14
11
RESTful mixin, mixin repo?
Hi, I just put together a little mixin to provide pseudo-RESTful services in camping apps. Basically, it looks for a hidden _verb field in form posts, and sets the @method to the supplied value (e.g. put or delete - which browsers don''t support). This lets you define put and delete methods in your controllers. Groovy. Code: http://pastie.caboo.se/22613 Is there any permanent repo of
2007 May 04
22
CampingConf?
Campers -- In a few weeks there will be a bunch of people in Portland, OR, for a conference. A long time ago some campers mentioned that might be a good time for us to get together and hold a mini CampingConf for a few hours. Is anyone interested? Does anyone want to organize it? I''m thinking Wednesday night, May 16. We could possibly get a spot at FreeGeek (not likely since they are
2006 Mar 02
0
March Ruby events in the SF Bay Area
Sadly, no South Bay Ruby events have been announced. C''mon, guys, make something happen... 3/14 6:00 pm Beginner''s Presentation - Chris Wanstrath will write a Ruby time server and discuss the code, to compliment Barce''s time server query script [from the Feb. meeting]. Chris says: "Nothing