similar to: Class Caching Problem [was Newbie Question about Custom Classes]

Displaying 20 results from an estimated 7000 matches similar to: "Class Caching Problem [was Newbie Question about Custom Classes]"

2006 Mar 31
5
Model reloading problem
Hi all, I''ve a model class Toto in the model directory. I don''t understand why i have to restarts WebBrick to view changes i make in this class FYI : in the development. rb i desabled class cache with config.cache_classes = false Regards Luciano -------------- next part -------------- An HTML attachment was scrubbed... URL:
2006 Mar 01
5
validations without AR - going crazy trying to find link
Hi, in the past few months someone posted an entry on their blog about how to do validations in non-AR classes and I cant find it any more. Anyone have a link? Thanks, Trevor -- Trevor Squires http://somethinglearned.com
2006 Feb 17
4
Table with Constants
I would like to have a table with some constants to use them later on for a drop down menu. How can this be done? My table looks like Table with constants ------------------------ id | key | value | type ------------------------ 1 | M | Male | sex .... I know it can be done like this <% select ''object'', ''method'', Constants.find(:all, :select =>
2007 Sep 21
3
TextMate Bundle and exception when switching to alternate file.
Hey, sorry if this is something better suited to another list. I''ve encountered a strange problem with the RSpec.tmbundle in trunk - namely that it was raising an exception when pressing ctrl-shift-downarrow (switch between spec and source - "Alternate File"). I tracked down the issue to be handling of the file_type in switch_command.rb#content_for() - the code expected the
2006 May 05
3
Plugin refresh time
Hi there, I''m currently developing a plugin to do authentication and authorisation. In the init.rb file of the plugin I have this code:- $:.unshift File.expand_path(File.join(File.dirname(__FILE__), ''lib'')) require ''open_advantage/authorisation'' ActionController::Base.send :include, OpenAdvantage::Authorisation and this is the skeleton of my
2006 Apr 11
11
I can''t get rails to see my plugin. How can I this?
I''m trying to produce a plugin to help me with my page caching woes. I can''t seem to get rails to see my method within the plugin. This is my first attempt at a plugin so I''m sure I''m missing something. I''ve created a directory /vendor/lib/plugins/broom_stick/. I then created an init.rb file with: require ''broom_stick'' I then
2006 Jun 26
5
How can I dynamiclly generate models?
I am trying to write a plugin, ''acts_as_commentable'', for my models - Image, Book, Music and so on, I do not want to use polymorphic association, so very model should have its own comment class. Here is my code acts_as_commentable.rb module Commentable def self.included(base) base.extend(ClassMethods) end module ClassMethods def
2006 Mar 08
2
Exciting Website Development
I am a single person company designing an exciting new web application for the general internet community. I am looking for 1 or 2 RoR developers keen to be involved in the development of an online application over the next few months. This project will initially be a free service for all internet user with the option for revenue through other sources later on - hence I am looking for
2006 Aug 08
3
params object nil in controller action
Hi All I am trying to implement a Back to Search Results functionality, by storing the user''s search criteria (params) in session and then reusing those params instead of request params when user clicks on "Back to Search Results link". here is my code ________________________________________________________________________ def search if session[:incidentSearch].nil? or
2006 Jun 01
3
rake create_sessions_table, does not create session table
when i run rake create_sessions_table, I get following output. tables donot get created and my application doesnot start. (in G:/rubysrc/blog) create db/migrate create db/migrate/001_add_sessions.rb info: the first time ran take everyting was fine, but now i have reinstalled ruby and rails and created the database, but i am unable to create session table with rake, please help.
2006 Apr 19
8
Module and Model
I am getting the following error /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb:1129:in `method_missing'': undefined method `directory?'' for Msg::File:Class (NoMethodError) I have a model called Msg::File in models/msg/file.rb, and I have a file in lib/msg/helper.rb which references to both Msg::File and File.directory? How do I help activerecord
2006 May 10
12
how best to implement lookup table?
Hi all - I''d like to implement a lookup table in my app that contains some reference data, just some status codes and their descriptions. What''s the most appropriate approach according to the "rails way" of doing things? Would I just implement a has_many relationship? Let''s say these are Order status codes, would the StatusCode have many Orders? This
2006 Apr 17
2
Understanding when flash gets reset (render vs. redirect_to)
All, I have a controller action that will do a different "render (:action)" call depending on whether or not data is valid. When the data is invalid - I set a flash element to hold a message. However, when I post back to this controller action and have valid data, I still have the flash element set, which I don''t want. I believe this is because I did a render from the
2006 Apr 17
3
Does render() have 2 be last statement in controller method?
I have a controller method that is attempting to do a render based on a potential error condition. So I have if (condition) render() else ..other code end ....other code in method Should I expect the render to take place immediately or does the render call not work because it isn''t the last statement in the method? Thanks, Wes -- Posted via http://www.ruby-forum.com/.
2006 Jun 07
4
Question: coding protected methods
Apologies first, because I need to ramp up on Ruby and coding Ruby in Rails, however it''s my 3rd day with this beast :) so I''m asking : When I added protected methods to the model before it was like: protected method.................... end Would this be a valid way to write a protected method as well ?: attr_protected :column1, :column2 Perhaps this particular call
2005 Dec 08
2
bounce effect
Hi, I was wondering if anyone has seen (or completed) an effect to make something ''bounce'' like icons do in the OS X dock when you launch them? Something that looks like there''s a bit of gravitational behavior to it? Thanks, Trevor Trevor Squires http://somethinglearned.com
2008 Jan 21
8
Polymorphic URL helpers documentation and fixes
Yesterday I answered a question regarding polymorphic URL helpers on Core ML and noticed that the module has no documentation. I''ve documented it and rewritten unit tests using Mocha. I also optimized some of the code slightly (nothing major, though). The patch also includes two fixes by Geoff Buesing, who has done awesome work in this area in the past.
2006 May 31
13
What are controller modules *for*?
I am aware that controllers can be placed in modules: ruby script/generate controller modulename/controllername But what does this buy me? Is it just a way of ensuring that my source code is nicely arranged, or can I use the fact that a set of controllers are all within a particular model to implement functionality common to all of those controllers? Why am I asking? The app
2006 Feb 15
2
extending rails via /lib - problems
I wanted to group some functions which I use in some models in one place. Controllers have application.rb and views have helpers but I couldn''t find anything about models. Using the /lib directory seemed to be the only way. Alright... so I have something like this: /lib/code.rb class ActiveRecord::Base def method_a(n) ....... end def method_b(n) ........ end end
2005 Nov 18
6
wrong number of arguments (2 for 1) error message help
All, This is really starting to get me as i can''t figure out why I am getting this error. Here is what is going on. I have a table called items and a item controller. When I add a new item to the items table I am also creating several associated tables. the code for this so that you can follow along is: def create @item = Item.new(params[:item]) # The item belongs to