RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

Submit a post

You can use basic HTML markup (e.g. <a>) or Markdown.
Note that your post may be edited to suit the format of the site.

As you are not logged in, you will be
directed via GitHub to signup or sign in

Post Preview

Note: Only the first pargraph is shown on the front page and overly long paragraphs may be broken up.

What Options Can Be Passed to the Active Storage #variant Method?

When Rails adds a large new feature like Active Storage, it takes some time before good Internet resources and documentation become available for it. This can be a challenge when learning how to use the variant method for image transformations. Not only does it take a lot of options, but the format of those options isn’t obvious. To make it easier, check out the resources and tips I’ve compiled here: http://www.carlosramireziii.com/what-options-can-be-passed-to-the-active-storage-variant-method.html

Gem for ruby-graphql authorization

As ruby-graphql do not come with the built-in authorization support, we’ve come with our own solution . Right now we support only CanCanCan and Pundit for checking abilities (and of course passing procs), but it’s fairly easy to extend it. Feedback and contributions are welcome!

There is . at the end of your url ;)
OMG : Fixed, thanks Jean!

Validating the Content-Type of Active Storage Attachments

Full validation support for Active Storage attachments won’t be arriving until Rails 6. Until then you’ll need to write your own custom validators to add this missing functionality. Last time I showed you how to write an attachment presence validator. Next I’ll share a validator which can restrict the content-type of your attachments. Drop this bit of code and its accompanying RSpec matcher into your project to tide you over until the next Rails release. http://www.carlosramireziii.com/validating-the-content-type-of-active-storage-attachments.html

Loading older posts