Bugfix: Wasn’t splitting tags!
This commit is contained in:
parent
1d9efa6cab
commit
b7bbd85c7e
|
@ -17,7 +17,7 @@ class MicropostsController < ApplicationController
|
||||||
def create
|
def create
|
||||||
micropost = Micropost.new(micropost_params)
|
micropost = Micropost.new(micropost_params)
|
||||||
micropost.user = helpers.current_user
|
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
|
if micropost.save
|
||||||
redirect_to micropost, notice: t(".created")
|
redirect_to micropost, notice: t(".created")
|
||||||
else
|
else
|
||||||
|
@ -30,7 +30,7 @@ class MicropostsController < ApplicationController
|
||||||
def edit; end
|
def edit; end
|
||||||
|
|
||||||
def update
|
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)
|
if @micropost.update(micropost_params)
|
||||||
redirect_to @micropost, notice: t(".updated")
|
redirect_to @micropost, notice: t(".updated")
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue