Bugfix: Wasn’t splitting tags!

This commit is contained in:
Trevor Vallender 2023-10-19 20:04:32 +01:00
parent 1d9efa6cab
commit b7bbd85c7e
1 changed files with 2 additions and 2 deletions

View File

@ -17,7 +17,7 @@ class MicropostsController < ApplicationController
def create
micropost = Micropost.new(micropost_params)
micropost.user = helpers.current_user
micropost.set_tags(params[:tags]) if params[:tags]
micropost.set_tags(*parse_tags(params[:tags])) if params[:tags]
if micropost.save
redirect_to micropost, notice: t(".created")
else
@ -30,7 +30,7 @@ class MicropostsController < ApplicationController
def edit; end
def update
@micropost.set_tags(params[:tags]) if params[:tags]
@micropost.set_tags(*parse_tags(params[:tags])) if params[:tags]
if @micropost.update(micropost_params)
redirect_to @micropost, notice: t(".updated")
else