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
Note: Only the first pargraph is shown on the front page and overly long paragraphs may be broken up.
This article is about how to implement pictures (or any other file) upload with the Grape + Trailblazer + CarrierWave stack. The first value of the stack (Grape) can be changed for anything else (Hanami, Sinatra, Rails API, etc) — it doesn’t matter. From the endpoint to the specs.
Agriya with the 16 years solid experience in the international market is the leading-edge web and clone script development company based in Chennai. We have an enhanced professional developers’ squad who are all involved in furnishing the business world with heaps of clone script solutions for the first-time and serial entrepreneurs to establish their own online platform eventually in a short period. [more inside]
Rails views can evolve into a complex mix of HTML and Ruby conditionals. Avoid writing complex tests by keeping views stupid: http://craftingruby.com/posts/2016/10/25/im-not-testing-those-stupid-views.html
This article describes setting up a custom scope for Devise login. https://solidfoundationwebdev.com/blog/posts/how-to-make-devise-use-custom-scopes-or-conditions-when-querying-users
A little bit of discipline goes a long way to keep your routes and controllers simple. Here’s a round up of simple techniques that can have huge impact on keeping things lean: https://medium.com/@jaryl/disciplined-rails-models-controllers-the-rails-way-bbc940822136#.l0ptywqsk
Using the knock gem, we will add JWT Authentication to our Rails API Application. https://www.driftingruby.com/episodes/rails-api-authentication-with-jwt
It is not a secret, that even having validations in Ruby on Rails application models through checking the uniqueness, two separate, but identical objects, can be saved to the database. This happens in services within subsequently full of users, which can simultaneously connect to the common database and write two similar records at the same time. To avoid such coincidences and to provide yourself with this kind of errors, I decided to look for methods at ruby gems communities. http://blog.active-bridge.com/how-to-add-database-constraint-validation-for-table
RubyGems or “gem” is a package manager for the Ruby programming language that provides a standard format for distributing Ruby programs and libraries. It is easy to manage and install to your system and it can be used by various rails applications. Just Checkout how to create a new gem and how to publish it.
I give a brief rundown on where and how I run into problems that need solving as well as a few tricks and cool things you can do with Ruby to figure out what’s going on. [more inside]
Git basic tutorial and Github printable cheatsheet, workflow and markdown cheats. http://www.techoalien.com/2015/07/git-basic-tutorial-and-github-printable.html
We will continue to speak about patterns in a good code! Gem draper is not a decorator! And cells too. Ivan Shamatov, the mentor, will tell you what a true decorator is in his new article. With real-life examples written in Ruby which will be very useful in your Ruby On Rails applications: https://mkdev.me/en/posts/not-the-full-truth-about-decorators
I’ve assembled a base Rails 5 application with search, a simple public and layout for everyone’s benefit. Some other features: ready to deploy to Heroku, Google Analytics and AWS ready to go with simple environment variable configuration. There’s much more that I’ll document and improve upon soon. [more inside]