My problem
----------

I have two forms for one model on two different pages (opinions and user) when I click submit the form on the user page it redirects me to the opinions page, I know that I can redirect to the same page that I redirect in the action create but is there a way to redirect user form to the user page

User controller
---------------

```
class UsersController < ApplicationController
  include TheUser
  before_action :set_user
  before_action :authenticate_user!
  before_action :user_signed_in?

  def index
    @users = User.all
    @mutual_friends = User.where(id: show_two_friends)

  end

  def show
    @user = User.find(params[:id])
    @new_opinion = Opinion.new

    respond_to do |format|
      if @user
        format.html
        format.js
        format.json { render :show, status: :created, location: @user }
      else
        format.html { render :new }
        format.json { render json: @user.errors, status: :unprocessable_entity }
        format.js
      end
    end
  end

  private

  def show_mutual_friends
    @ids = []
    current_user.friends.each do |person|
      person.friends.each do |m|
        @ids << m.id
      end
    end
    @ids.reject { |x| x == current_user.id }
  end

  def show_two_friends
    show_mutual_friends.sample(2)
  end
end

```

Opinions controller
-------------------

```
class OpinionsController < ApplicationController
  include TheUser
  before_action :set_user
  before_action :set_opinion, only: [:show, :edit, :update, :destroy]

  # GET /opinions
  # GET /opinions.json
  def index
    @opinions = Opinion.all.order("created_at DESC")
    @opinion = Opinion.new
  end

  # POST /opinions
  # POST /opinions.json
  def create
    @opinion = @user.opinions.build(opinion_params)

    respond_to do |format|
      if @opinion.save
        format.html { redirect_to opinions_url, notice: 'Post was successfully created.' }
        format.json { render :show, status: :created, location: @opinion }
      else
        format.html { render :new }
        format.json { render json: @opinion.errors, status: :unprocessable_entity }
      end
    end

  end

  # PATCH/PUT /opinions/1
  # PATCH/PUT /opinions/1.json
  def update
    respond_to do |format|
      if @opinion.update(opinion_params)
        format.html { redirect_to @opinion, notice: 'Opinion was successfully updated.' }
        format.json { render :show, status: :ok, location: @opinion }
      else
        format.html { render :edit }
        format.json { render json: @opinion.errors, status: :unprocessable_entity }
      end
    end
  end

  # DELETE /opinions/1
  # DELETE /opinions/1.json
  def destroy
    @opinion.destroy
    respond_to do |format|
      format.html { redirect_to opinions_url, notice: 'Opinion was successfully destroyed.' }
      format.json { head :no_content }
    end
  end

  private
    # Use callbacks to share common setup or constraints between actions.
    def set_opinion
      @opinion = Opinion.find(params[:id])
    end

    # Only allow a list of trusted parameters through.
    def opinion_params
      params.require(:opinion).permit(:user, :body, :user_id)
    end
end

```

User form
---------

```
<%= form_with(model: @new_opinion, local: false) do |form| %>
  <div class="field rich p-3">
    <div class="control">
      <%= form.rich_text_area :body, label: "What's Your Opinion", input_html: {class: "textarea"}, wrapper: false, label_html: {class: "label"}, placeholders: "Your opinion...", autofocus: true %>
    </div>
  </div>
  <%= form.button :submit   %>

<% end %>

```

Opinions form
-------------

```
<%= form_with(model: @opinion, local: true) do |form| %>
  <div class="field rich p-3">
    <div class="control">
      <%= form.rich_text_area :body, label: "What's Your Opinion", input_html: {class: "textarea"}, wrapper: false, label_html: {class: "label"}, placeholders: "Your opinion...", autofocus: true %>
    </div>
  </div>
  <%= form.button :submit, class: "button is-info" %>

<% end %>

```

I will really appreciate it if you guys help me with this it's my final project
===============================================================================