Created
April 24, 2009 14:22
-
-
Save julesfern/101123 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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