This plugin hasn’t been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

Rails Theme

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 main 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

This also supplies a convenience option to add classes to the so that you can match the body styles in your rails app.

Troubleshooting

  1. My theme doesn’t show up at all.

Turn on WP_DEBUG in wp_config.php and see if there is an error message printed to the page.

Screenshots

  • This is the options page.

FAQ

How do I get rails to ignore the WP’s PHP?

If you are using Passenger and Apache, put this in your conf file (assuming you want the WordPress site to be accessible
through /news):

<Directory "/path/to/rails/app/public/news">
    PassengerEnabled off
    AllowOverride all
</Directory>
How do I get the URL for the WP blog look like the URLs for my Rails app?

If you create a symbolic link in your public folder to the wp site, then you can use the URL /news to get to your blog:

cd path/to/rails/app/public
ln -s /path/to/wordpress/installation news

Changelog

1.1.1.0

  • Retry the call to rails, since the rails app or the network might be slow.

1.1.0.0

  • Added the option to add classes to .

1.0.3.0

  • Removing the pass through of cookies, since later versions of Rails invalidates the session when it sees the cookie
    coming from the wrong place.

1.0.2.0

  • Using WP_Http to make the server call to work in more configurations.
  • Improved error reporting.

1.0.1.0

  • Pass the page’s cookies through to the rails app.

1.0

  • Initial release.

Contributors & Developers

This is open source software. The following people have contributed to this plugin.

Contributors

Browse the code