Intro To View Components In Ruby On Rails 7

Sdílet
Vložit
  • čas přidán 30. 05. 2024
  • View Components allow you to create reusable, unit testable components that you can preview in the browser.
    Checkout my courses at learn.deanin.com
    localhost:3000/rails/view_components
    viewcomponent.org/guide/getti...
    github.com/github/view_component
    github.com/jonspalmer/view_co...
    storybook.js.org/
    Join this channel to help support these videos:
    / @deanin
    Follow me on social media:
    linktr.ee/deanin
    Join this channel to get access to perks:
    / @deanin
    If you liked this video, please consider subscribing: t.co/RZ4EwP0F2a
    Timestamps
    0:00 View Component Demo
    2:00 Installing View Components
    2:40 Creating The Header Component
    9:19 Testing The Header Component
    15:36 Creating The Post Component
    21:32 Testing The Post Component
    26:10 Preview View Components In Browser
    #Deanin #Software #Programming

Komentáře • 16

  • @tomasvalent3876
    @tomasvalent3876 Před rokem +3

    View Components Rails + Tailwindcss == ❤❤❤

  • @tselle
    @tselle Před rokem +2

    @Deanin super appreciate all you do for the community! Small correction due to changing libs... as of 2.67.0 you no longer need to include ViewComponent::RenderPreviewHelper...
    2.67.0
    Use ViewComponent::Base.config as the internal endpoint for config.
    Simon Fish
    Fix bug where #with_request_url, when used with query string, set the incorrect request.path and request.fullpath.
    Franz Liedke
    Add link to ViewComponentAttributes in Resources section of docs.
    Romaric Pascal
    render_preview test helper is available by default. It is no longer necessary to include ViewComponent::RenderPreviewHelper.
    Joel Hawksley

  • @Selbstzensur
    @Selbstzensur Před rokem +1

    I am back to rails after 10 years. Had some time with ruby and sinatra years ago. Now i'm doing a rails course on udemy and i like how rails developed from the good to the better. It's not the hyped thing anymore but it is a very well designed and documented tool that i really love to get to know again.

  • @davidcordero9864
    @davidcordero9864 Před rokem

    I liked this tutorial. Looking forward to more!!

  • @ichalzeya
    @ichalzeya Před rokem +1

    Thanks, good jobs

  • @jouzou3709
    @jouzou3709 Před rokem +1

    thank you for the tutorial

  • @rafikbinlutfur2777
    @rafikbinlutfur2777 Před rokem +2

    Nice Video

  • @xaogao
    @xaogao Před rokem +1

    thx for the video

  • @TheNorbdus
    @TheNorbdus Před rokem

    Hi @Deanin, great video. I need to componentize buttons with JS tooltips, but I need to reload them after rendering. Can I put the js inside the component? I'm using rails 7 with stimulus. I appreciate the help.

  • @pablo6263a
    @pablo6263a Před rokem +2

    thanks deanin! can you make a tutorails on invoices or reports to pdf?

    • @Deanin
      @Deanin  Před rokem +1

      I'll take a look at it! I think there was a gem that could handle it, but I'm not sure. I'll definitely take a look though.

  • @Mosiah369
    @Mosiah369 Před 7 měsíci

    The last part of video when u use "include ViewComponent::RenderPreviewHelper" doesn't work in Rails 7.1.0 - Ruby 3.1.0 - gem "view_component", "~> 3.6".
    Error:
    /RailsLearning/rails-learning/test/components/post_component_test.rb:6:in `': uninitialized constant ViewComponent::RenderPreviewHelper (NameError)
    ViewComponent 2.67.0 says:
    "render_preview test helper is available by default. It is no longer necessary to include ViewComponent::RenderPreviewHelper." - Joel Hawksley.
    Thanks! Good video tutorial about View Component in Ruby on Rails!

  • @antnbaranov
    @antnbaranov Před rokem +2

    Thank u! If you have any ideas on working with cryptocurrency, just payments aka wallet/bank app, transactions would also be very interesting!

  • @tonypetruzzi9266
    @tonypetruzzi9266 Před rokem

    i think you glance over the fact that you need to add `gem "view_component"` to your Gemfile.