Skip to content

Instantly share code, notes, and snippets.

@julesfern
Created April 24, 2009 14:22
Show Gist options
  • Select an option

  • Save julesfern/101123 to your computer and use it in GitHub Desktop.

Select an option

Save julesfern/101123 to your computer and use it in GitHub Desktop.
class Application < Merb::Controller
Merb.add_mime_type(:smil, :to_smil, %w[application/smil+xml] )
# Set the seed repository if the controller expects seed_key
# TODO: define API patterns in router.rb
def _call_action(*args)
if @seed
@seed.inside { super }
else
super
end
end
private
def require_seed_context
if n = params[:seed_name]
@seed = Seed.first(:name=>n)
end
raise NotAcceptable, "Request requires a valid seed name. You gave seed_name: #{params[:seed_name].inspect}" unless @seed
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment