Chris Oliver

Joined

292,890 Experience
93 Lessons Completed
295 Questions Solved

Activity

Posted in ¿How make I to upload multiple images with refile?

Hey Saul, check out this section on their readme: https://github.com/refile/refile#multiple-file-uploads

Posted in Autocomplete a form field

Benny,

Have you looked into collection_select? It will let you make a dropdown for the product_id on the sale form. It'll automatically load up all the Products in the database and create a dropdown for you.

Then you could do something like select2 (https://select2.github.io/examples.html) on that form field to make it do autocomplete.

https://github.com/argerim/select2-rails

Posted in API TOKEN DEVISE

Ján, that's pretty interesting. I would suggest creating a Github Issue on devise_token_auth and explaining your problem there. Hopefully the author will see it and be able to help out. I'm not familiar enough with the gem to help unfortunately.

Posted in Activity Feed From Scratch Discussion

Depending on how that's setup, you might patch the Vote model so that if you created events matched to the vote, you could delete those. You can't really set this up on virtual attributes because you need it attached directly to the records so when things get deleted you can remove the related records.

Super awesome! Thanks for this. :)

Posted in Handle money in Rails

Oh that's a really interesting question. I've never really considered that because we only use it in the other notation.

I would imagine that the Money gem can do the conversion for you and that internally it really saves them as decimals but tweaks the string output so that it uses comma for the decimal. I think you would want to continue saving with the decimal format and then have a method that converts the value into a Money object and that would be what you interact with. You could also probably have a setter method that lets you set the value via the comma version of the string which converts to the decimal one in the database.

Posted in Activity Feed From Scratch Discussion

This is a fantastic question. If you setup the reverse dependency and set the dependent destroy option, that will delete the events when you delete the comment.

class Comment
has_many :events, as: :eventable, dependent: :destroy
end

Ha! Thanks!

Posted in Setup Ubuntu 14.04 Trusty Tahr Discussion

Yes indeed! I noticed that recently. Thanks for the reminder!

Posted in Bug in search

I think it works, but I was getting alerts from Pingdom about some errors lately. Restarted the Heroku dynos and all seems to be going well again. Searching for the word "type" seems to work again. Thanks for the heads up! :)

In that case, the User models would belong inside the tenants.

Great question Fritz and thanks for the compliment! :)

So I'm using Wistia because they're really the best video hosting platform for paid content (in my opinion). They have a great API, lots of awesome features like email capture during the video, and do a good job around protecting paid content. Overall, they can be a bit pricey but it's a great service for the business related features if you're looking for something like that.

Posted in Must Read / Must Watch

https://500ish.com/simple-smile-thumbs-up-8865f5912d84

Thought this was pretty fantastic description of the new slack reactions. I really think they are valuable. The syntax for typing them sucks a bit, but it's getting there.

Thanks David! :)

Posted in Activity Feed From Scratch Discussion

Yep! That's correct. It's actually another model instance but just given the name of "eventable" because it could be of various types of models.

I'm still planning on it! I just need to get started honestly. What I wanted to do was wrap up my vlogs about simple-calendar and then hop into that after I'm done. Those should be finished in the next couple days.

You might be able to, I'm not entirely sure. The full names make it more complicated.

You can inspect the HTML on Facebook to get an idea of how they do it. They have a much more complex system for it as you'll see with their "highlighter" class right above the textarea. Rather that doing much of this in text, they handle much of it in the JS instead so they can do more complex things. An out-of-the-box JS library like at.js won't be able to compete with that.

Posted in Why are these partials rendering differently?

Haha such markdown fail.

Posted in Why are these partials rendering differently?

I'm pretty sure an i tag isn't intended to be wrapped around a form. That's likely invalid HTML that the browser strips and replaces.

Great points! Upvoting so everyone can see this. :)