similar to: DRY encoding conversion and onload ajax execution

Displaying 20 results from an estimated 10000 matches similar to: "DRY encoding conversion and onload ajax execution"

2006 Mar 17
3
Timestamps casted to nil?
Hi, for some reason, all timestamp fields with or without time zone in my Postgres tables seem to be casted to nil. From console: >> me = User.find(''PS12345'') => #<User:0x2379788 @attributes={"mtime"=>"01.03.2006 13:26:32.737166", "valid"=>"8", "valid_from"=>"01.03.1999 14:09:21 CET",
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
2006 Mar 27
5
Fake ActiveRecord model?
Hi all, I have a legacy table which I cannot get to work with ActiveRecord (no ids etc). All I want is to create a class which opens a connection manually and allows me to execute some plain SQL statements. What I can''t figure out is how to either build up a connection and execute queries from a non-AR inherited class, or how to create a AR-inherited class minus all the AR magic and
2006 Mar 26
7
MVC Design
Hello I have been using LAMP for the last 6 years and i am now finally making the choice to move over to RoR. This MVC stuff is all very new to me. As i have no trouble understanding ruby code... or any code for that matter.. my challange comes in getting my head around the MVC stuff. Is there any demos articles that you guys have seen that takes a site or a business breif and explains where
2006 Jun 27
2
Preloading results in Ajax App
Hello Rails lovers! I have a few general discussions that I have yet to find terribly active. Perhaps all of the people busy on this front are...uh...busy on this front. So! Ajax-only apps. No degration. Yes! Forget about degradation for a moment. Not willing to? Ok, well...this question is for those who are willing... Imagine developing an app that is one page - all actions render partials
2006 Jan 22
3
"onload" event handler inside a div
Hi. I need help on what is essentially putting an "onload" event handler into a div. I am using render :partial and when the partial is loaded, I would like the divs to show using an effect from a library such as scriptaculous or moofx. However, there is no "onload" for a div. I was wondering what alternative methods I should use to achieve this. Thanks! -- Posted via
2006 Oct 20
7
MVC and modules. Views telling models to behave
I was thinking today, it would be nice if a view could tell a model how to format it''s data for that particular view. Kind of like, the view is bestowing instant, and temporary knowledge on the model for the duration of the views run. It seemed to me that this would be more objecty than say a helper that formats a string format_my_string( my_string ) Instead, in my view. Lets assume I
2006 Aug 03
5
DRYing up the view
Hello everyone! I have generic views for CRUD operations For example I render(''shared/list'') from controller shared/list.rhtml ... <% for item in @list %> <tr class="<%= cycle ''list-line-odd'', ''list-line-even'' %>"> <%= render :partial => ''item'', :locals => { :item => item } %>
2006 Jan 17
30
MVC design good/bad
I am curious what you find is good and bad MVC design. Let''s use the find and find_by_sql methods as examples. Currently I have these spread out all over the place... View: here I have some find methods when I am for example populating a select list with choices in a form. Controller: here I have the simpler find methods. Model: here I have the more complicated find methods (usually
2007 Nov 01
8
Specifying mixins
Hi folks, Can anyone share some accumulated wisdom about the best way to spec mixins in general, and (Jamis Buck-style) ActiveRecord "concerns" in particular? The standard situation here is that there''s a bunch of functionality, related by concept if not by implementation, that one wants to inherit in many different classes (e.g. ActiveRecord models) without having to
2005 Nov 21
2
NAMESPACE, S4, and .onLoad
The Writing R Extensions manual instructs developers who use S4 classes and methods in a package with a name space to: There needs to be an .onLoad action to ensure that the methods package is loaded and attached: .onLoad <- function(lib, pkg) require(methods) I'm wondering if listing methods in the Depends field of the package's DESCRIPTION file is sufficient.
2011 Oct 15
2
.onLoad failing because could not find function "loadMethod"
Hi, This strange warning happen sometimes when running 'R CMD check': * checking whether the package can be loaded with stated dependencies ... WARNING Error : .onLoad failed in loadNamespace() for ?pkgB?, details: call: length(new("A")) error: could not find function "loadMethod" Error: package/namespace load failed for ?pkgB? Execution halted
2008 Dec 09
7
subclassing vs mixins, which one should be used?
Hey all, I have two models in my rails project that share a lot of traits. They each have the same 4 properties, and now I need to add 2-3 methods to each one that will be the same. In the spirit of DRY I am looking for a solution to write these methods only once. Both of these models already inherit from ActiveRecord . . . and I didn''t know if it was safe to just "whip up" a
2011 Jun 23
1
Class not found when search in .onLoad
Hi, I am facing with a strange behaviour of isClass and extends when these are called in .onLoad in both R 2.12.1 and R 2.13.0. This is preventing my package from doing some object initializations at a proper place (i.e. in .onLoad). Suppose one defines two S4 classes in a package, and that one needs to check the inheritance between these two when loading the package (e.g. to validate slots
2006 Jun 16
11
Detecting Body Onload
I have a piece of code that "waits" for body onload. Every 30ms, it tests $(''body''). Seems that isn''t always good enough. I''ve hit situations where the DOM is "partially" loaded somehow. I fixed matters by setting a global flag... <body onload="bodyLoaded=true;"> which provides a better test... of course I could
2016 Jan 30
2
Best way for rgl's .onLoad to fail?
On OSX and Linux, the rgl package currently requires X11 libs to be available for linking. Recent versions of OSX don't include them by default, so I'd like rgl to fail nicely. Ideally, it will load a library that doesn't need to link to the X11 libs but will still allow WebGL code to work, but that's complicated, so I'd like a stopgap. I can detect that the failure is
2007 Mar 23
4
DRY - with modules, render_component or.. ?
I have an B2B application where a pretty complex order form needs to be submitted and edited on the admin controller, buyer controller and seller controller with some small differences. How do I make available the edit order methods all controllers? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are
2009 Aug 26
5
Noob DRY method question
Hi Gurus, I''m learning the Rails framework, and I have this exact block of html/javascript in two places in an if/else construct in application.html.erb: <body onload="Modalbox.show(''<div class=\''warning\''> <p> <center> <%= flash[ :notice ] %> </center> </p> <p> <center> <input
2008 Aug 06
1
R CMD check message that I can't figure out (.onLoad failed)
I have been able to track and fix everything so far with R CMD check. How do I make this reproducible and I will do it. this is the message that I got: Error in fun(...) : couldn't connect to display ":0.0" Error : .onLoad failed in 'loadNamespace' for 'tcltk' -- Let's not spend our time and resources thinking about things that are so little or so large that
2013 Oct 03
1
check warning with .onLoad() and setClass()
Hi I am writing a package in which I define a new class in the .onLoad() hook: ,---- | .onLoad <- function(libname, pkgname) { | setClass( | "inDrak", | representation( | init = "SpatialGridDataFrame" | ), | contains = "simObj" | ) | } `---- The class "simObj" is defined in the package, which