Skip to content

Commit

Permalink
bug fixed (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
krillan49 authored Jan 22, 2025
1 parent 8079f84 commit 9f11341
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/controllers/podcasts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ def create
format.turbo_stream do
render turbo_stream: [
turbo_stream.replace("podcast_frame", partial: "podcasts/podcast", locals: { podcast: @podcast }),
turbo_stream.append("flash", partial: "layouts/flash", locals: { message: notice })
turbo_stream.append("flash", partial: "shared/flash", locals: { message: notice })
]
end
format.html { redirect_to @podcast, notice: notice }
else
format.turbo_stream do
render turbo_stream: [
turbo_stream.replace("form", partial: "podcasts/form", locals: { podcast: @podcast }),
turbo_stream.replace("alert", partial: "layouts/errors", locals: { resource: @podcast })
turbo_stream.replace("alert", partial: "shared/errors", locals: { resource: @podcast })
]
end
format.html { render :new }
Expand All @@ -52,15 +52,15 @@ def update
format.turbo_stream do
render turbo_stream: [
turbo_stream.replace("podcast_frame", partial: "podcasts/podcast", locals: { podcast: @podcast }),
turbo_stream.append("flash", partial: "layouts/flash", locals: { message: notice })
turbo_stream.append("flash", partial: "shared/flash", locals: { message: notice })
]
end
format.html { redirect_to @podcast, notice: "Your podcast was successfully updated." }
else
format.turbo_stream do
render turbo_stream: [
turbo_stream.replace("form", partial: "podcasts/form", locals: { podcast: @podcast }),
turbo_stream.replace("alert", partial: "layouts/errors", locals: { resource: @podcast })
turbo_stream.replace("alert", partial: "shared/errors", locals: { resource: @podcast })
]
end
format.html { render :new }
Expand Down

0 comments on commit 9f11341

Please sign in to comment.