I have the following models:

```
class Blog < ApplicationRecord
  has_many :posts
end

class Post < ApplicationRecord
  belongs_to :blog
end

```

Right now I have only two routes:

* `/blogs/:blog_id/posts` - to create a post
* `/posts/id:` - to update a post

I'm not sure if I should change the second one to also accept a `:blog_id`. The update method (on the controller) doesn't need to use the site to update a post:

```
class PostsController < ApplicationController
  before_action :set_site, only: [:create]
  before_action :set_post, only: [:update]

  PERMITED_POST_PARAMS = [
    :post_id,
    :title,
    :url,
    :body
  ].freeze

  def create
    @post = @site.posts.build(post_params)

    if @post.save
      render json: @post, status: :created
    else
      render json: @post.errors, status: :unprocessable_entity
    end
  end

  def update
    if @post.update(post_params)
      render json: @post
    else
      render json: @post.errors, status: :unprocessable_entity
    end
  end

  private

  def post_params
    params.require(:post).permit(*PERMITED_POST_PARAMS)
  end

  def set_post
    @post = Post.find(id)
  end

  def set_site
    @site = Site.find(site_id)
  end

  def post_id
    params[:post_id]
  end

  def id
    params[:id]
  end
end

```

My question is: is it ok to do what I'm doing, or it a bad practice?

Thank you.