Displaying 20 results from an estimated 10000 matches similar to: "Where should "business logic" reside in Rails?"
2005 Aug 22
8
Observing changes to a text field
I''ve noticed that using several TimedObservers (prototype.js) on a page
to watch for changes to text fields (haven''t tried forms) can have a
non-negligible effect on the CPU cycles used by the browser process.
Nothing dramatic, to be sure, but unnecessary.
Autocompleter.Base (controls.js) follows a smarter strategy to watch for
changes. Currently this functionality is tied
2006 May 03
7
Business Logic and where to place with rails
I am having an issue of deciding where I should put the business code
for example the more complex code coming off the controller. Right now,
I am just thinking to put it in the ''lib'' directory and the do something
along these lines:
require_dependency "system_process"
class SystemMessageController < ApplicationController
include SystemProcess
...
...
Where
2005 Aug 18
8
Extending a js class
It''s been a few days since I posted my last two emails (of which, no one
replied to) so I''ve gone ahead and coded a working slider class as well
as a ''resizeable'' class that allows a user to drag and resize the
element. I also linked these two together as I want to have slider
behavior that can resize the resizeable element. The end result is both
the
2005 Jun 28
2
Problems with repeated calls to setTimeout?
Prototype.js and Thomas''s effects scripts use repeated setTimeout calls
for timed looping, for instance in time-based observers.
On Konqueror 3.4.1 (possibly other khtml-based browsers, too), these
observers reproducibly crash the browser. Just keeping open a browser
with such an observer is enough. After some time it invariably
segfaults. When I substitute setInterval for setTimeout
2007 May 10
6
Where put buissness logic?
I''ve always think that it belongs to controller but I''ve read few
articles that it should be done by model and controller should be thin
glue betwean model and view. Where should I put it?
Regards
--
I''ve probably left my head... somewhere. Please wait untill I find it.
Homepage (pl_PL): http://uzytkownik.jogger.pl/
(GNU/)Linux User: #425935 (see
2005 Jul 26
6
implement audit trail table
has anyone has any idea how to implement audit trail table for all update /
deletion done on records?
I''m thinking to have corresponding audit trail table to each table, so
everthing before an update or deletion is done, a new record will be insert
into the corresponding audit trail table.
Is there a way to overwrite the save, destroy, method at the application
level? so that I do not
2006 Jul 28
12
MenuEngine
Hi all,
MenuEngine is a small Rails engine that can generate templated
drop-down DHTML menus commonly used for web site navigation. Supports
creation of menus from a YAML file, from code and from pre-configured
HTML. Optionally integrates with UserEngine for authorization.
http://www.muermann.org/ruby/menu_engine
Project page:
http://rubyforge.org/projects/menuengine
This is my first attempt
2005 Aug 08
7
JS Input/Validation Library
Does anyone has any thoughts about starting a project to simplify
client-side form validation and input? I started thinking about this
because I think date input in most web applications is broken. I
really like Simon Willison''s demo:
http://simon.incutio.com/code/js/date-parser/
I think this could be improved (by mapping say shift+left-arrow to
the previous day, and
2005 Jan 13
10
Program logic behind Ruby On Rails
Hi, I''m a newbie in both Ruby and Ruby on Rails. I finished the Ruby on
Rail Tutorial on Todo list and it was great. But, now I''m trying to
understand the logic behind it, that is something that is not obvious on
how each one of them ties together.
Is there a flowchart that shows how the inner working of Ruby on Rails?
In another words, let''s suppose we consider the
2009 Apr 19
19
Controller spec: testing that scope is set
In a Rails controller I set the scope on a model class in an around
filter. I have defined expectations on the model classes, and ideally, I
would add a further expectation for the scope. Is this already possible
in some way? How would I go about adding support a scope expectation?
Michael
--
Michael Schuerig
mailto:michael at schuerig.de
http://www.schuerig.de/michael/
2005 Aug 13
4
Timing out ajax requests?
Has someone come up with a generic way to handle ajax requests that
exceed a certain time?
In my concrete case, I have several select boxes for drilling down a
hierarchy. When the user clicks an option, the next deeper level is
retrieved. To avoid multiple concurrent requests, I disable the select
box. As the request may take too long or cause an error, I set a
timeout that re-enables the
2006 Jul 27
9
Introspecting validates_presence_of
Hello people,
I''d like to detect whether an attribute of a model has
vaildates_presence_of applied to it so I can automatically apply a
mandatory (*) to the field...it doesn''t look easy...any ideas?
Cheers,
--
Dan Webb
http://www.danwebb.net
2005 Jun 29
2
Unit testing
Recently, I''ve started to write unit tests for some of my scripts. In
general,it''s no worse in JavaScript than in Ruby or Java. I didn''t have
the courage to try Selenium, but had a look at JsUnit. Unfortunately,
in Konqueror it produces unfathomable errors and in Firefox it is slow
beyond imagination.
Anyway, writing tests for functions that are computational or
2005 Sep 06
4
url_for: :overwrite_params went missing
Somewhere between 0.13.1 and the current SVN version
the :overwrite_params option to url_for (and related methods) went
missing. I can''t tell whether this was deliberate or by mistake, and I
have no idea how to get the same functionality in some other way
either.
Michael
--
Michael Schuerig Life is what happens
2006 Aug 08
7
Useful plugins for RadRails
Hi Friends,
Could anybody suggest me some nice and useful plugins for RadRails! It would
be very great if we make list of all such plugins!
1)________
2)________
3)________
4)________
5)________
6)________
7).....
Please fill above blanks and lets make a big list of it!
--
Don''t live to geek; geek to live.
http://anilw.info
-------------- next part --------------
An HTML attachment
2006 Jul 28
4
Validation Reflection plugin
The validation reflection plugin adds three things
(1) Reflective access to validations
- ModelClass.reflect_on_all_validations
- ModelClass.reflect_on_validations_for(:property)
(2) It provides "declarative" methods for defining
validations based on database metadata
- validates_presence_of_mandatory_content_columns
- validates_lengths_of_string_attributes
-
2005 Sep 13
12
PDF views?
I know there''s wiki page on generating PDF[*], but that''s not really
what I want. I don''t need to create arbitrary PDF. What I''d like to do
is create PDF templates and fill in the blanks. Roughly, I''m looking
for functionality akin to the mail merge feature of word processors,
including conditional and repeated elements, say, table rows.
Michael
2005 Sep 25
2
Preventing/allowing exceptions to occur in Element.add/remove ClassName
Hello everyone !
Thomas asked me to discuss here the behavior of Element.addClassName, as
relating to ticker #2232 [1]. In HEAD, if the element passed-in to
Element.addClassName does not exist, an exception is thrown, and script
execution stops there.
I believe this is inconsistent with other functions:
Object.extend(Element, {
hasClassName: function(element, className) {
element =
2005 Aug 04
10
Rails Spin-offs WIKI.
http://rails-spinoffs.bombdiggity.net/index.php?title=Main_Page
guys here is the wiki. Once you register let me know and I''ll give you
full access to the site.
Jon
Jon Whitcraft
Online Services
(317) 492-8623
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2006 Jul 27
9
CalendarHelper
Has anyone had any luck using the CalendarHelper plugin at
http://wiki.rubyonrails.com/rails/pages/CalendarHelper recently?
I''m scratching my head over the following error when I look at any page
in my application:
NameError in CalendarController#index
undefined local variable or method `date_format'' for
#<CalendarController:0x24ccd4c>
RAILS_ROOT: