Skip to content

Instantly share code, notes, and snippets.

View Shadowfiend's full-sized avatar
💇
Studioin'.

Antonio Salazar Cardozo Shadowfiend

💇
Studioin'.
View GitHub Profile
4)
NoMethodError in 'UserSessionsController when showing session data as JSON should return the UserSession converted to JSON'
undefined method `params' for #<ActionController::TestRequest:0x3137dd0>
/Library/Ruby/Gems/1.8/gems/authlogic-2.0.11/lib/authlogic/controller_adapters/abstract_adapter.rb:30:in `params'
/Library/Ruby/Gems/1.8/gems/authlogic-2.0.11/lib/authlogic/session/params.rb:95:in `params_credentials'
/Library/Ruby/Gems/1.8/gems/authlogic-2.0.11/lib/authlogic/session/params.rb:71:in `params_enabled?'
/Library/Ruby/Gems/1.8/gems/authlogic-2.0.11/lib/authlogic/session/params.rb:65:in `persist_by_params'
/Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:178:in `send'
/Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:178:in `evaluate_method'
/Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/callbacks.rb:166:in `call'
@implementation MyClass : CPObject
{
}
- (CPNumber)reverse
{
return 5;
}
@end
if ([delegate respondsToSelector:@selector(view:didDoSomething:)])
[delegate view:self didDoSomething:param];
- (void)setDelegate:(id)aDelegate
{
delegateProxy = [DelegateProxy proxyWithDelegate:aDelegate];
}
/**
* Fixes some issues where SuperTab has trouble editing labels that have
* been truncated.
*
* The original SuperTab uses the same textField used by regular tabs to
* _display_ the label to edit it, as well, simply setting it to an
* editable text field instead of merely a dynamic one. However, when
* the tab truncates the text of the field for width, and then is edited
* again, this means that the text in the editable field is truncated.
*
[delegateProxy view:self didDoSomething:param];
private object noCometResponseSent extends SessionVar[Boolean](false)
LiftRules.redirectAjaxOnSessionLoss = false
LiftRules.noCometSessionPage = "/home"
// Returns true if we should send an empty response for a comet request,
// false otherwise. This is used to ensure we don't send multiple
// window.location redirects in the event of a server restart in response
// to comet requests. Sending multiple ones can send Firefox into an
// In cases where we have an AJAX request for IE with an uploaded file, we
// assume we served through an iframe (a fairly safe assumption) and serve
// up the response with a content type of text/plain so that IE does not
// attempt to save the file.
LiftRules.responseTransformers.append {
resp =>
(for (req <- S.request) yield {
resp match {
case InMemoryResponse(data, headers, cookies, code)
if ! req.uploadedFiles.isEmpty &&
collection.find (error, cursor) ->
cursor.toArray (error, results) ->
# Do stuff with results.
@Shadowfiend
Shadowfiend / gist:965176
Created May 10, 2011 19:17
ReloadOnSessionLoss.setup can be run in Boot.scala
package bootstrap.liftweb {
import net.liftweb.common._
import net.liftweb.http._
import js._
import LiftRules._
import net.liftweb.util.Helpers._
/**
* Provides automatic reloading of the client on session loss.
*