mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-26 12:16:22 +00:00
fix: no usar PostRelation para instanciar un nuevo Post #7537
obligaba a cargar casi todo el sitio en memoria y muchas lecturas de disco
This commit is contained in:
parent
59828b3f6a
commit
1ad4eeccb4
1 changed files with 4 additions and 2 deletions
|
@ -54,9 +54,11 @@ class PostsController < ApplicationController
|
||||||
|
|
||||||
def new
|
def new
|
||||||
authorize Post
|
authorize Post
|
||||||
@post = site.posts(lang: locale).build(layout: params[:layout])
|
|
||||||
|
|
||||||
breadcrumb I18n.t('loaf.breadcrumbs.posts.new', layout: @post.layout.humanized_name.downcase), ''
|
layout = site.layouts[params[:layout].to_sym]
|
||||||
|
@post = Post.build(locale: locale, layout: layout, site: site)
|
||||||
|
|
||||||
|
breadcrumb I18n.t('loaf.breadcrumbs.posts.new', layout: layout.humanized_name.downcase), ''
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
|
Loading…
Reference in a new issue