=== Rails Theme === Contributors: paulrosen Donate link: http://www.performantsoftware.com/wordpress/plugins/rails_theme/ Tags: rails, theme Requires at least: 3.2 Tested up to: 3.3 Stable tag: 1.0.2.0 This calls back to a Rails (or other) web service to get theme information, so that it is easy to keep the rails and WP sides in sync. == Description == This calls back to a web service to get theme information, so that it is easy to keep the rails and WP sides in sync. It is designed to be used when a Rails application wishes to contain WordPress content. This allows the WordPress pages to directly use the styles of the Rails application so that it will always match, even when the Rails app changes. It is also useful when the header of the page changes, for instance, if new menu items can appear depending on the state of the application. And finally, if you want to POST back to the Rails app (for instance, to log in), you need the CSRF to be set in the page's header, and that needs to come from the Rails session. NOTE: This might take some tweaking depending on the theme you are using. It successfully works with the default 2011 theme and the Hybrid theme. It requires an entry point in your Rails controller that returns three things: 1. a section that is put in the header to load stylesheets and javascript, 1. a section that is loaded at the top of the body, and 1. a section that is loaded at the bottom of the body. There is one option in the plugin to tell it the base URL of the Rails app. The rails app is expected to respond to the following URL: `/wrapper` == Installation == The plugin itself is easy to install. 1. Upload this folder to the `/wp-content/plugins/` directory. 1. Activate the plugin through the 'Plugins' menu in WordPress. 1. Click 'Settings' in the dashboard, then 'Rails Theme' and enter the base URL for your Rails app. There are a number of things that have to happen on the Rails side, though. You will need something like the following in your routes.rb file: `get "/wrapper" => "home#wrapper" ` And it should return a partial with three sections. The sections should be separated from each other with 10 tildes (that is: `~~~~~~~~~~`). It is most convenient to rearrange your layout file to call those three partials. Here is a possible layout file: `
<%= render :partial => '/layouts/dependencies' %>