Add Comments with Ruby on Rails

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ธ.ค. 2024

ความคิดเห็น • 16

  • @EnjoytheMents
    @EnjoytheMents 3 ปีที่แล้ว +2

    Nice! Your videos are on of the best. Thanks for taking the time to do them

    • @cjav_dev
      @cjav_dev  3 ปีที่แล้ว

      Thanks for watching!

  • @sosscs
    @sosscs ปีที่แล้ว

    what is the authenticity token you added in the form? what video did you explain it in, thanks

    • @cjav_dev
      @cjav_dev  ปีที่แล้ว

      It's for preventing cross site request forgery: www.writesoftwarewell.com/how-rails-authenticity-tokens-protect-against-csrf/#:~:text=These%20cryptic%20values%20are%20called,time%20the%20session%20is%20regenerated.

  • @talhakhan4457
    @talhakhan4457 2 ปีที่แล้ว

    CJ, how can I add a key binding to vs code for the type html form skeleton that you have?
    Trust me I have tried my technical sophistication skills.

  • @merlin2049er
    @merlin2049er 2 ปีที่แล้ว

    I messed up somewhere. I'm using blog (for posts) & blog_comments (for comments), and my form action is
    but it's not finding it.

  • @swetadas4073
    @swetadas4073 2 ปีที่แล้ว

    Hello sir.. I'm trying to create comment section in my app.. I have model named comment_post.. When I'm trying to save comment I'm getting following error
    param is missing or the value is empty: comment_post
    In the line second line of function
    def comment_post_params
    params. require(:comment_post). permit(:body)
    end
    I tried removing require(:comment_post) part.. But then my parameters are nil..
    Can you please help me regarding this

  • @calebstevens8269
    @calebstevens8269 3 ปีที่แล้ว

    Why aren't you wrapping the post resources in the user like
    Resources user do
    Resources post
    End

    • @cjav_dev
      @cjav_dev  3 ปีที่แล้ว

      We could, but I prefer to keep the routes as shallow as possible and don’t feel like seeing the user and it’s ID in the path has any extra value, at least for this use case.

    • @calebstevens8269
      @calebstevens8269 3 ปีที่แล้ว

      @@cjav_dev could you do a video specifically on routes? They confuse me a lot. I thought you had to nest then to show ownership

  • @norverage6500
    @norverage6500 2 ปีที่แล้ว

    Would you be so kind and direct me how to delete these comments? Thanks

    • @cjav_dev
      @cjav_dev  2 ปีที่แล้ว

      Ah. So Comment.find(comment_id).destroy should work for an individual and Comment.destroy_all should delete all

    • @TohmanHD
      @TohmanHD 2 ปีที่แล้ว

      @@cjav_dev I don't get it, I don't know how could I make a delete button to a comment

  • @juancamiloforero124
    @juancamiloforero124 2 ปีที่แล้ว

    genial