search for: mephistoblog

Displaying 20 results from an estimated 124 matches for "mephistoblog".

2007 May 14
6
ActiveResource and RESful edit
Hi I''d like to know how to have ActiveResource generate a URL for the /teams/1/edit type of resource. I''ve got custom_methods.rb and have used Team.find(1).get(:edit) This generates http://localhost:xxxx/teams/1/edit.xml But all I get returned is a hash of the attributes (in this case of team 1), rather than an object of team 1. In other words the
2006 Oct 31
12
Moving page_cache_directory
Howdy. I''m working on a RoR CMS and need cached pages to all be in public/cache rather than public [in order to set svn:ignore on all the files properly]. I can get page_cache_directory set correctly and the pages are cached in the right place but Mongrel isn''t serving them because it''s only looking for them in public. During development I know I can set -r public/cache
2007 Sep 09
4
Images larger than 40k uploaded with attachment_fu won't display
I have a problem displaying images when using attachment_fu. When I try to display the image, only about 40k appears in the browser, and with some images even that much is not visible (just garbage when I view source). I can display images smaller than 40k correctly. I''m storing the images in the database (mysql) and haven''t tried storing in the file system to see if that works
2006 Sep 26
12
resource_feeder feedback
Let me apologize in advance as this is a topic that I feel passionate and opinionated about. If I''m coming on too strong, please forgive me. === Be opinionated=== My first piece of advice is simple: be opinionated. Change the method name to simply <feed_for>. Have it default to doing the right thing. Perhaps give an option to change the default feed format, but default to
2007 Jul 24
9
will_paginate plugin doesn't work with Association Extensions?
I have: class Post < ActiveRecord::Base has_many :comments do def published find( :all, :conditions => {:published => true} ) end end end When in my controller I do Post.find(:first).comments.published.paginate :page => params[:page] I get an error undefined method `paginate'' for []:Array Is will_paginate supposed to
2007 May 10
13
REST own action
I can sent my own action to a users_controller stating in routes.rb map.resources :users, :member => { :network => get } I defined in my users_controller the network action.... so I can have an url like "http://localhost:3000/users/168.xml;network" now I would like to have another action network_plus which is a little bit different fron the network.. sure, I can state another
2006 Sep 16
10
Mongrel and Sandbox
Z-Man, DHH recently said: "And [_why''s] latest work on sandbox looks stellar. Making it drop-dead easy to run multiple Rails applications in the same Mongrel process without conflicts. Thumbs up to both him and Matz for getting Sandbox on track for inclusion with the next Ruby release." Does that mean what I think it means - that one or more Mongrel processes may one day be
2006 Nov 17
6
RESTful routes and resulting urls
if I have the following in my routes.rb: map.resources :product_categories it provides urls such as: /product_categories /product_categories/1 /product_categories/1;edit etc. and uses the ProductCategories controller. how can I keep the same controller (and model) but set up the resources so that I can have any abitrary url point to the existing controller, much like specifying the controller
2006 Oct 15
1
mongrel_send_file gem plugin
...that runs on Mongrel (not just rails), just monkey patch the SendFile#find_session method. Submit suggestions as patches if you have them too. [1] - http://railsexpress.de/blog/articles/2006/09/15/sqlsessionstore-now-available-as-a-plugin -- Rick Olson http://weblog.techno-weenie.net http://mephistoblog.com
2007 Jun 11
2
Builder::XmlMarkup and dashes
Has anyone hacked Builder::XmlMarkup to dasherize underscore tags by default? I know I can use tag!, but I''d like to find a way for it to translate underscores to dashes automatically. In other words: xml.department_manager do "fred end #=> <department-manager>fred</department-manager> I tried hacking Builder::XmlBase.method_missing but got myself all twisted up!
2007 Mar 01
4
Cookie based session management problems
Edge has a change in default behaviour where sessions are stored as cookies instead of in the file system. This was a pleasant surprise when I synced up, fired up my app, and nothing worked. Ah, life on the edge. I''m sure I''m just missing something, but I can''t get sessions to survive the first redirect. I added the following code to environment.rb, based on
2006 Nov 20
7
Acts as attachement
Hi guys Question about acts as attachment still getting the following error undefined method `content_type'' I have set everything up according to the following page however i am still have trouble http://weblog.techno-weenie.net/articles/acts_as_attachment One thing, I have wanted to add this to an existing model in my system. I have not used the... script/generate
2006 Oct 13
2
form_for() and name
how can i give name attributes for form_for(), so it will give an output like <form name="f">. it is because that i need to access the form name for javascript manipulation. as far as i know, name can only used in form_tag(), but i currently have more than 50 forms that built using form_for(). the structure is like this: <% form_for symbol, item, :url => { :action
2006 Oct 19
8
Mongrel::HttpHandlerPlugin
Hi, I''m trying to write a file upload monitor for mongrel that uses juggernaut to alert the browser of a change. I''m writing a plugin that uses Mongrel::HttpHandlerPlugin but it looks like the only method that gets called is process and that is only when the upload has finished. I''m setting the following: @request_notify = true But I am still only getting process to
2007 May 05
3
DB trigger vs before_create
Hello everyone, I''m having trouble figuring out which approach is better. I have the following tables: products, orders and line_items. Every time an Order is placed, the quantity field in the products table has to be updated for each LineItem in the Order. One option is to use DB triggers which is not as portable as using before_create in the Order model. But with before_create I cannot
2006 Oct 24
9
[WARN] Got 99% CPU?
Hey folks, I ran into a few people at RubyConf who were having 99% CPU issues. Please contact me if you meet the following criteria: 1. You are running a production site. 2. You are experiencing 99% CPU errors. 3. This is frequent enough that you cannot manage it. Thank you. Please contact me off-list about it. -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/
2006 Oct 15
14
Mongrel can''t handle some URLs that IE6 sends
IE6 happily sends unsafe* characters unencoded if you''ve typed them into the URL bar of your IE6 window. This could happen if you copy & paste a URL from an email or web page. Mongrel doesn''t seem to handle these properly. In 0.3.13.3 it would print out something like: Sun Oct 15 23:05:38 CST 2006: BAD CLIENT (192.168.1.2): Invalid HTTP format, parsing fails. 0.3.13.5
2007 Apr 05
5
Odd error handling in ActionView#compile_template causes WSOD
If a view file cannot be compiled (eg it has a block with a missing ''end'' statement), I''m experiencing WSODs - the browser reports a lost network connection, rather than the helpful compilation error that we used to have. When the compilation fails, ActionView#compile_template raises this error : TemplateError.new(find_base_path_for(file_name || template), file_name ||
2007 Jun 26
3
what is the :or parameter in a submit_tag ?
I read the following tag in teh Beast example <%= submit_tag''Login'', :or => link_to_function(''forgotten password'', "$(''reset-password'').toggle();") %> I understand the link_to_function, but what is this :or parameter used for ? the link doesn''t appear, so it cannot be used... thanks for your lights kad --
2006 Nov 24
4
[OT] I Finally Got an Atom Feed
Hi folks, I took a break from Mongrel today and instead whipped up an Atom feed generator for my site. People who love or utterly hate my essays will lover or utterly hate to subscribe to it. http://www.zedshaw.com/feed.atom Let me know if it isn''t working well in your favorite feed reader. -- Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu http://www.zedshaw.com/