cada articulo modifica el sitio para calcular la fecha de modificacion mas rapido

This commit is contained in:
f 2020-05-11 19:01:41 -03:00
parent d63f7a75e9
commit a24cc25e1b

View file

@ -15,7 +15,7 @@ class PostsController < ApplicationController
@posts.sort_by!(:order, :date).reverse!
@usuarie = @site.usuarie? current_usuarie
fresh_when @posts
fresh_when @site
end
def show
@ -40,6 +40,8 @@ class PostsController < ApplicationController
params: params)
if (@post = service.create.persisted?)
@site.touch
redirect_to site_posts_path(@site)
else
render 'posts/new'
@ -65,6 +67,8 @@ class PostsController < ApplicationController
params: params)
if service.update.persisted?
@site.touch
redirect_to site_posts_path(@site)
else
render 'posts/edit'
@ -85,6 +89,7 @@ class PostsController < ApplicationController
# TODO: Notificar si se pudo o no
service.destroy
@site.touch
redirect_to site_posts_path(@site)
end
@ -98,6 +103,7 @@ class PostsController < ApplicationController
params: params)
service.reorder
@site.touch
redirect_to site_posts_path(@site)
end