From abcf4f684a51941fd0a6821f230d076e7918e4ab Mon Sep 17 00:00:00 2001 From: did Date: Fri, 3 Jun 2011 02:25:19 +0200 Subject: [PATCH] help to create public form with has_one field --- lib/locomotive/liquid/drops/content.rb | 4 ++++ lib/locomotive/render.rb | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/locomotive/liquid/drops/content.rb b/lib/locomotive/liquid/drops/content.rb index 58613178..5525bbfc 100644 --- a/lib/locomotive/liquid/drops/content.rb +++ b/lib/locomotive/liquid/drops/content.rb @@ -4,6 +4,10 @@ module Locomotive class Content < Base delegate :meta_keywords, :meta_description, :to => '@source' + def _id + @source._id.to_s + end + def before_method(meth) return '' if @source.nil? diff --git a/lib/locomotive/render.rb b/lib/locomotive/render.rb index 75052207..c8d10e9f 100644 --- a/lib/locomotive/render.rb +++ b/lib/locomotive/render.rb @@ -62,7 +62,8 @@ module Locomotive 'asset_collections' => Locomotive::Liquid::Drops::AssetCollections.new, 'contents' => Locomotive::Liquid::Drops::Contents.new, 'current_page' => self.params[:page], - 'params' => self.params + 'params' => self.params, + 'url' => request.url }.merge(flash.stringify_keys) # data from api if @page.templatized? # add instance from content type