Skip to content

Instantly share code, notes, and snippets.

@roman
Created July 21, 2009 22:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roman/151685 to your computer and use it in GitHub Desktop.
Save roman/151685 to your computer and use it in GitHub Desktop.
<%= embed_action :controller => 'roman_embedded',
:action => 'index' %>
class RomanEmbeddedController < ApplicationController
def index
render :text => 'HELLO WORLD'
end
end
class RomanTestsController < ApplicationController
def index
render :action => 'index', :layout => false
end
def another
embed_action :controller => 'roman_embedded',
:action => 'index'
end
end
ActionController::Routing::Routes.draw do |map|
map.connect "/roman_tests/index", :controller => 'roman_tests', :action => 'index'
map.connect "/roman_tests/other", :controller => 'roman_tests', :action => 'another'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment