Taylor Cooney

Joined

2,160 Experience
3 Lessons Completed
1 Question Solved

Activity

Posted in Migrating From jQuery to Vanilla Javascript Discussion

If you have an issue with partials, try the new to_attachable_partial_path method.

Yup! For standard use you can just pass it the content from a record that has handlebars in it, and call render with a parameters hash.

<%= Liquid::Template.parse(@blog.custom_content).
      render('page_content' => Post.first.content, 'page_title' => Post.first.title) %>

Posted in How do I overlay form fields in a PDF?

You typically see this feature in the electronic signature apps, like Docusign and HelloSign where a user can upload PDF versions of documents and use a drag and drop tool to map fields they would like to have filled out by other users.

The ideal user flow would be to 1) upload a PDF, 2) see a sidebar of available fields (like text, checkbox, signature), 3) have the ability to overlay and resize a field from the sidebar over the PDF, and 4) save a final PDF that is fillable.
I'm trying to understand how something like this would work, and if anyone has explored it in the past.

This rocks, coupled it with my MessagesController for Group Chats to reduce some of the load for the larger chats with lots of messages.

You could add a currency field to your Company model, and allow it do be modified through the CompaniesController#edit action. This way I can have my locale as Spanish, but select any currency that I want and see that across the application.

I’m looking to explore a feature for a CRM that allows a user to add tags or labels to a customer record. They might not have the tags or labels in the database and I think it would be more intuitive to have an action like the example interface below where you can say Add New Tag which will submit and have it added to the Tags list.

Image: https://aws1.discourse-cdn.com/standard10/uploads/stimulusjs/original/1X/aaa107ea6a977a89212545d60249805f113ab264.gif

I’ve had create success using jQuery plugins like selectize.js and select2, however I’m trying to move away from jQuery as a crutch. I wonder if that is something a Stimulus controller should controller but I haven’t been able to find any reference to a select or create all-in-one that allows users to add new tags or labels to a customer. Does anyone have any materials I could reference for this?

Posted in Two Factor Authentication With Devise Discussion

No worries, as a rule of thumb postgres is much more powerful than SQL Lite. To configure your next Rails app for Postgres, run this command: rails new myapp --database=postgresql

Benjamin and John, thanks a bunch for sharing this.

Posted in Two Factor Authentication With Devise Discussion

Can you create a gist with the Users::SessionsController and your Two Factor Auths controller? The above example isn't enough context to see what's going on

Posted in How do I properly use the delegate method?

Thanks for confirming that Chris, I loved the latest episode on Google Maps.

I think delegate is a great way to limit the responsibility of keeping the data in-sync, if Reservation, Customer and User all had individual address attributes and top level attributes, like name, email, phone number, that could be a PITA to keep up-to-date.

Posted in How do I properly use the delegate method?

I'm curious how this can be correctly applied to a booking application. If you have a Reservation and Customer model, does it make sense to store information such as the first name, last name, and email address on the Reservation model, as well as the Customer model, or is this where delegate could be used?

I'm not sure if this is an obscure way to use it and should be storing this information on both models.

Nomad List is a crowdsourced database of cities for Digital Nomads. They do this really cool thing for SEO where as you apply filters, the database is queried and the home page dynamically updates to display the best matching city. Crucially, the results of each filter query are also unique URLs.

Here is a photo of an example, https://imgur.com/a/B5xuVqF

For example, if I want to filter place in europe, it appends this, places-in-the-european-union, instead of ?place=european-union

The HTML markup of their link is interesting. Does anyone have an idea of how to do this?

<div class="filter half choices c1">
            <div class="choice active" data-filter-slug="near-a-beach" data-filter-slug-position="after" data-filter-target="tags" data-filter-type="partial-match" data-filter-value=",beach">
                            <span>⛱ Near beach</span>
            </div>
</div>

Nice! Funny timing, with this I'm hoping to pair it with some sort of CNAME domain alias pointing to offer "Stores" for low-traffic accounts. Anything major that you're finding in Rails 6 with this approach or am I safe to hop in and start?

Hey Chris, before diving into the code side of things is there anything now after looking back that you would advise on with this approach? After chatting with Heroku, they advised against multiple schemas and to take a column scoped approach.

Posted in Inbound SMS in Rails with Twilio Discussion

Thanks Chris. Ended up using this to programatically send a text message after a user completes an order, and allow that user to ask questions, creating a conversation, where we can respond from the website.

Posted in Migrating From jQuery to Vanilla Javascript Discussion

If you set a data map for the Rails path, can you replace fetch(`/mentions.json?query=${text}`) with this.data.get("url")? I'm having issues with it where I get an undefined error in console.

Posted in How do I customize a Google Maps marker (like AirBNB)?

I'm curious if anyone has experience customizing the marker in Google Maps, a la AirBNB . I understand how the icon works but I haven't had success replicating the marker with the arrow, and price exactly like the photo.

let marker = new google.maps.Marker({
        position: pos,
        map: this.map,
        title: facility.name,
        icon: {
          path: 'M22-48h-44v43h16l6 5 6-5h16z',
          fillColor: '#00CCBB',
          fillOpacity: 1,
          strokeColor: '',
          strokeWeight: 0

        },
        label: {
          text: "$75",
          color: "#FFF",
          fontSize: "14px",
          fontWeight: "bold"
        }
      })

Posted in How do I insert smart variables with a text editor?

TTT

Posted in How do I insert smart variables with a text editor?

Sorry to spam but still looking for some insight here. I've tried looking up across the web but having trouble finding anything related to the idea.

Posted in How do I structure a Bookings table for two models?

I've primarly built out support to book a flight, and now I'm looking to offer the ability to book a hotel as well. I'm looking for some insight on the best way to model this:

Currently there is a Reservations table that has a flight_id and user_id. Does it make sense to create an entirely new table for Hotel reservations, or modify the exisiting Reservations table to support polymorphic assocaitons? Instead of flight_id, it would have a reservable_type and reservable_id. Off the top of my mind, ActiveRecord will be unable to build any join from a polymorphic assocation without additional information.

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more.

© 2024 GoRails, LLC. All rights reserved.