base layout on id instead of name
This commit is contained in:
parent
6e100d3499
commit
fc98757772
|
@ -15,8 +15,8 @@ class Page < Item
|
||||||
def setup_default_value
|
def setup_default_value
|
||||||
super
|
super
|
||||||
|
|
||||||
if self.layout_name
|
if self.layout_id
|
||||||
self.layout_id = Layout.first(:conditions => {:name => self.layout_name} ).id
|
self.layout_name = Layout.find(layout_id).name
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -15,8 +15,8 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<%= f.label :layout_name, t('admin.layout_name') %>
|
<%= f.label :layout_id, t('admin.layout_name') %>
|
||||||
<%= f.select :layout_name, Layout.all.map{ |l| [l.description, l.name] } %>
|
<%= f.select :layout_id, Layout.all.map{ |l| [l.description, l.id] } %>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<%= f.label :layout_name, t('admin.layout_name') %>
|
<%= f.label :layout_id, t('admin.layout_name') %>
|
||||||
<%= f.select :layout_name, Layout.all.map{ |l| [l.description, l.name] } %>
|
<%= f.select :layout_id, Layout.all.map{ |l| [l.description, l.id] } %>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
Loading…
Reference in New Issue