Matt, Check out the "share_layouts" extension in the core repository. It lets you specify a Radiant layout to use when rendering your standard Rails actions.
Sean Matt Hughes wrote: > I currently have two Rails apps for my site: one Radiant that serves > the static context and a regular Rails app that does forms and > authentication. Apache sits in front and figures out which app gets > which URL. > > It's becoming a problem -- as you can imagine -- since both apps need > to look the same. What I'd really like to do is merge the dynamic > functionality into an extension and use Radiant to wrap the dynamic > content with the specified layout. > > I've read the tutorial on creating extensions and have already created > a custom tag or two. But I can't figure out how to use my layout when > rendering from my extension: > > > ------------------------------------------------------ > ../extensions/user_status/user_status_extension.rb > # Define a new custom route > class UserStatusExtension < Radiant::Extension > ... > > define_routes do |map| > map.with_options(:controller => 'foo') do |foo| > foo.bar 'foo/bar', :action => 'bar' > end > end > > ... > end > > ------------------------------------------------------ > ../extensions/user_status/app/controllers/foo_controller.rb > > # Have empty action that should point right to view > def bar > end > > ------------------------------------------------------ > ../extensions/user_status/app/views/foo/bar.rhtml > > Hello from Bar! > > > > Now when I hit my Radiant app with: http://localhost:3000/foo/bar > "Hello from Bar!" is rendered, but it is rendered using the Radiant > admin layout (in radiant/app/views/layouts/application.rhtml. > However, I want to be able to specify (either in my controller or my > view) to use the custom layout that is being pulled from the Radiant > database. For example, can I do this in my controller: > > layout(:from_db) > > > Does this make sense? Is anyone else mixing apps like this? Is > anyone doing forms in Radiant and how are you going about it? > > > > Thanks a lot. I hope to add to the site's documentation once I get my > thoughts together and get through this project. > _______________________________________________ > Radiant mailing list > Post: [email protected] > Search: http://radiantcms.org/mailing-list/search/ > Site: http://lists.radiantcms.org/mailman/listinfo/radiant > > _______________________________________________ Radiant mailing list Post: [email protected] Search: http://radiantcms.org/mailing-list/search/ Site: http://lists.radiantcms.org/mailman/listinfo/radiant
