4 Ways to Create Dependent Drop-Downs With Ruby on Rails 7

Поділитися
Вставка
  • Опубліковано 6 вер 2024

КОМЕНТАРІ • 21

  • @fabiantorresm
    @fabiantorresm 4 місяці тому

    Your channel is very good, I have learned a lot from you, thank you. Congratulations on your channel. Hey, sorry for the question, can you create a system of custom fields with this? For example, create a post that has an attribute called post_type that can be a post, page, product and depending on what the user chooses, a form with different fields is displayed, of course these fields will be saved in another table so that each type of post has its own attributes and each post its own values

    • @mixandgo
      @mixandgo  4 місяці тому +1

      Thanks. I'm glad you like the channel.
      Sure. You can create that.

  • @adrianthedev
    @adrianthedev 2 роки тому +4

    Amazing! I'd like to add something dependent fields to Avo pretty soon. This will come in handy. Thanks!

    • @mixandgo
      @mixandgo  2 роки тому +2

      Let me know how it goes.

    • @brandonzylstra
      @brandonzylstra 2 роки тому +2

      haha, I just saw your work on this in Avo and thought "oh good, I don't need to implement it myself" 😄

    • @adrianthedev
      @adrianthedev 2 роки тому +1

      Nice! Yeah, the Stimulus integration is quite nice! Give it a try and let me know how it goes.

  • @asgerwolff9992
    @asgerwolff9992 2 роки тому +2

    I just implemented a similar feature on a site using Nuxt but this is so much nicer.
    Great video, looking forward to the release of your new course Cezar

    • @mixandgo
      @mixandgo  2 роки тому

      I'm glad you like it.

  • @mycode0
    @mycode0 2 роки тому +1

    Can't wait for the course

    • @mixandgo
      @mixandgo  2 роки тому +1

      The first cohort is launching next month. So make sure to join the waiting list.

    • @mycode0
      @mycode0 2 роки тому +1

      Already done ✅

  • @viktorsmari
    @viktorsmari 2 роки тому +2

    Great video! Most often when I am using "select" I am already inside a form, do you know if we can get around that, since we cannot have a form nested inside a form? So if you would have the same example, but where you need to post and save the selected fields to an object record. If this was a Car object, and you could save the make, model, year, and maybe description (String) also when saving.

    • @mixandgo
      @mixandgo  2 роки тому

      I'm not sure I understand the issue, but if you had a more non-standard setup... you could probably do that as well with more JS.
      But it's hard to give advice on something I don't fully understand.

    • @frbb20
      @frbb20 2 роки тому

      @@mixandgo what I think Victor means is that these 3 selects would be part of a larger form with many other fields, so the solution of wrapping them in a turbo frame wouldn’t work, because it would submit the entire form regardless, losing the state in all other fields (and also potentially submitting the form prematurely).

    • @mixandgo
      @mixandgo  2 роки тому

      @@frbb20 ah that makes sense, thank you for clarifying.
      One option is to have a form object with some validation rules.
      So until all the required data is filled in, it's in an invalid state.
      Does that make sense?

  • @epicrato
    @epicrato 2 роки тому

    Excellent information. Thanks for putting it together!

    • @mixandgo
      @mixandgo  2 роки тому

      I'm glad you like it :)

  • @ysuzukihk
    @ysuzukihk Рік тому

    Thank you for your Video!! I saw "year","make",model" and "body_styles" on CSV file.
    I would like to add code ""
    But arranged code is not run.
    If possible ,could you give me any advice ?

    • @mixandgo
      @mixandgo  Рік тому

      No idea without more context. I would suggest you post a question on StackOverflow

    • @ysuzukihk
      @ysuzukihk Рік тому

      Thank you for your message!!!
      I will post message on StackOverFlow soon.
      If possible , could you let me know why csv file has "body_styles" ?
      Is it so that learners like me can modify the code on their own?

    • @mixandgo
      @mixandgo  Рік тому

      ​@@ysuzukihk I'm not sure what you mean by that...
      If it's in the context of a car, then body style refers to how the car's body style (e.g., sedan, coupe, etc.).