- Aug 2024
- Jul 2024
-
medium.com medium.com
-
This is classic Rails Magic - a clever side effect that guarantees the token in the session cookie will always match the token on the page, because rendering the token to the page can't happen without inserting that same token into the cookie.
-
- May 2024
-
github.com github.com
-
github.com github.com
-
You'll need to either stop transpiling or use a Node-based transpiler, like those in jsbundling-rails and cssbundling-rails.
-
-
-
The asset pipeline is a collection of components that work together. Here's a list of what they might be.Concatenation for merging together many files into one big file.Minification for compressing the contents of a file to make it smaller in size.Pre-compilation for using your language of choice to write CSS or Javascript.Fingerprinting to force reloading of asset changes (i.e., cache busing).
-
-
stackoverflow.com stackoverflow.com
-
I can confirm that this is still actual for Rails 7 - jpEg converts to jpg and your production fails.
-
-
nickjanetakis.com nickjanetakis.com
-
Personally I’m not a fan of running migrations in an ENTRYPOINT script.I think it’s best suited to run this separately as part of your deploy process
-
-
mattbrictson.com mattbrictson.com
-
Performing a redirect by constructing a URL based on user input is inherently risky, and is a well-documented security vulnerability. This is essentially what you are doing when you call redirect_to params.merge(...), because params can contain arbitrary data the user has appended to the URL.
Tags
Annotators
URL
-
- Mar 2024
-
blog.litsea.net blog.litsea.net
-
foreign_key: { to_table: :assoc_name }
Tags
Annotators
URL
-
- Feb 2024
-
github.com github.com
Tags
Annotators
URL
-
- Jan 2024
-
mattbrictson.com mattbrictson.com
-
Some frameworks call this “template inheritance”. In this example, we might say that the application layout “inherits from” or “extends” the base layout. In Rails, this is known as nested layouts, and it is a bit awkward to use. The standard Rails practice for nested layouts is complicated and involves these considerations
-
But what if you want to reuse one layout within another?
-
- Dec 2023
- Nov 2023
-
-
On reload, the namespaces are safe, won't be reloaded. The loader only reloads what it manages, which in this case is the adapter itself.
-
-
guides.rubyonrails.org guides.rubyonrails.org
-
In this example, we still want app/models/shapes/circle.rb to define Circle, not Shapes::Circle. This may be your personal preference to keep things simple, and also avoids refactors in existing code bases. The collapsing feature of Zeitwerk allows us to do that:
-
-
edgeguides.rubyonrails.org edgeguides.rubyonrails.org
-
pp Rails.autoloaders.main.dirs
-
-
-
People want to autoload from lib, which is understandable. If we can, this use case should have first-class support from the framework.
-
-
-
-
authenticate_by addresses the vulnerability by taking the same amount of time regardless of whether a user with a matching email is found: User.authenticate_by(email: "...", password: "...")
-
-
stackoverflow.com stackoverflow.com
-
helper.singleton_class.include Rails.application.routes.url_helpers
-
ArgumentError: arguments passed to url_for can't be handled. Please require routes or provide your own implementation
-
- Oct 2023
-
rubynor-web-next-lime.vercel.app rubynor-web-next-lime.vercel.app
-
t.daterange :period
-
- Sep 2023
-
-
What can we do to undo this commit?
-
- Aug 2023
-
stackoverflow.com stackoverflow.com
-
I assume that the ActiveStorage::Attachment class gets reloaded dynamically and that the extensions are lost as they are only added during initialization. You’re correct. Use Rails.configuration.to_prepare to mix your module in after application boot and every time code is reloaded: Rails.configuration.to_prepare do ActiveStorage::Attachment.send :include, ::ActiveStorageAttachmentExtension end
-
- May 2023
- Mar 2023
-
github.com github.com
-
before_action -> { doorkeeper_authorize! :public }, only: :index
-
-
stackoverflow.com stackoverflow.com
-
What you're actually trying to do is to have the exact same behaviour that native Devise implementation but on an Engine via API
-
-
-
stackoverflow.com stackoverflow.com
-
kevinjmurphy.com kevinjmurphy.com
-
Our test raises an ActiveRecord::RecordNotFound exception. We know that Rails has special handling to return a 404 status code in this case. However, the request spec still raises the exception.
-
-
- Feb 2023
-
stackoverflow.com stackoverflow.com
-
The reason is Rails only reads and creates the session object when it receives the request and writes it back to session store when request is complete and is about to be returned to user.
-
Session race conditions are very common in Rails. Redis session store doesn't help either! The reason is Rails only reads and creates the session object when it receives the request and writes it back to session store when request is complete and is about to be returned to user.
-
-
-
As you can see from the example, the session cookie is updated on every request, regardless of if the session was modified or not. Depending on when the response gets back to the client last, thats the cookie that will be used in the next call. For example, if in our previous example, if get_current_result’s response was slower than get_quiz, then our cookie would have the correct data and the next call to update_response would of work fine! So sometimes it will work and sometimes not all depending on the internet gods. This type of race condition is no fun to deal with. The implications of this is that using cookie storage for sessions when you are doing multiple ajax call is just not safe.
-
A better solution would be to use a server side session store like active record or memcache. Doing so prevents the session data from being reliant on client side cookies. Session data no longer has to be passed between the client and the server which means no more potential race conditions when two ajax are simultaneously made!
-
- Jan 2023
-
stackoverflow.com stackoverflow.com
- Dec 2022
-
github.com github.com
-
When configuring SMTP settings in an after_initialize block, the settings aren't picked up by ActionMailer. This leads to runtime errors, since ActionMailer tries the default settings.
-
- Nov 2022
-
github.com github.com
- Sep 2022
- Jul 2022
-
www.reddit.com www.reddit.com
-
It really only takes one head scratching issue to suck up all the time it saves you over a year, and in my experience these head scratchers happen much more often than once a year. So in that sense it's not worth it, and the first time I run into an issue with it, I disable it completely.
-
-
github.com github.com
-
discuss.rubyonrails.org discuss.rubyonrails.org
-
Overriding the ActiveStorage controllers to add authentication or customize behavior is a bit tedious because it requires either: using custom routes, which means losing the nice url helpers provided by active storage copy pasting the routes in the application routes.rb, which is not very DRY.
-
-
github.com github.com
-
it should be normal for production apps to add authentication and authorization to their ActiveStorage controllers. Unfortunately, there are 2 possible ways to achieve it currently: Not drawing ActiveStorage routes and do everything by yourself Override/monkey patch ActiveStorage controllers None of them is ideal because in the end you can't benefit from Rails upgrades (bug fixes, etc) so the intention of this PR is to let people define a parent controller (inspired by Devise, maybe @carlosantoniodasilva can tell us his experience on this feature) so that people can add authentication and authorization in a single place and still benefit from the default controllers.
-
- Apr 2022
-
kit.svelte.dev kit.svelte.dev
-
The combined stuff is available to components using the page store as $page.stuff, providing a mechanism for pages to pass data 'upward' to layouts.
bidirectional data flow ?! That's a game changer.
analogue in Rails: content_for
-
-
edgeguides.rubyonrails.org edgeguides.rubyonrails.org
-
rubyonrails.org rubyonrails.orgDoctrine1
-
Tags
Annotators
URL
-
-
rubyonrails.org rubyonrails.org
-
topdigital.agency topdigital.agency
-
Top Web Design & Development Agencies Winter 2022
Interesting list of agencies. Know guys from ukrainian company Sloboda Studio. They provide high-quality service on time and at a reasonable cost.
-
-
github.com github.com
-
after_commit { puts "We're all done!" }
Notice the order: this is printed last, after the outer (real) transaction is committed, not when the inner "transaction" block finishes without error.
-
-
mattbrictson.com mattbrictson.com
-
In Rails, this is known as nested layouts, and it is a bit awkward to use. The standard Rails practice for nested layouts is complicated and involves these considerations:
-
- Mar 2022
-
github.com github.com
-
github.com github.com
-
- Feb 2022
-
blog.saeloun.com blog.saeloun.com
-
github.com github.com
Tags
Annotators
URL
-
-
guides.rubyonrails.org guides.rubyonrails.org
-
As of Rails 7.0+, Active Record has an option for handling associations that would perform a join across multiple databases.
impressive
-
-
guides.rubyonrails.org guides.rubyonrails.org
-
You can also use silence_redefinition_of_method if you need to define the replacement method yourself (because you're using delegate, for example).
-
-
github.com github.com
-
composed_of attr, :class_name => 'AddressableRecord::Address', :converter => :convert, :allow_nil => true,
-
-
-
belongs_to :city
-
-
github.com github.com
-
belongs_to :zipcode
-
-
github.com github.com
-
acts_as_tokened Quickly adds rails 5 has_secure_token to your model, along with some Post.find() enhancements to work with tokens instead of IDs.
-
include Effective::CrudController
-
# All queries and objects will be built with this scope resource_scope -> { current_user.posts } # Similar to above, with block syntax resource_scope do Post.active.where(user: current_user) end
-
-
github.com github.com
-
enumerate_by :alpha_2_code
-
-
www.ruby-toolbox.com www.ruby-toolbox.com
- Jan 2022
-
stackoverflow.com stackoverflow.com
-
guides.rubyonrails.org guides.rubyonrails.org
-
403 :forbidden
-
401 :unauthorized
-
-
coreyward.svbtle.com coreyward.svbtle.com
-
Rails 5 recently shipped, and among many other new features is a new renderer that makes it easy to render fully composed views outside of your controllers.
-
- Dec 2021
-
-
How to Create a Micro-Job Marketplace Like Fiverr: Features, Cost, TimelineTimurTech JournalistMarketplaceProduct GuideHomeBlogEntrepreneurshipHow to Create a Micro-Job Marketplace Like Fiverr: Features, Cost, TimelinePublishedNov 19, 2021UpdatedNov 19, 202120 min readIt’s no secret that the COVID-19 pandemic has led many people to reconsider their jobs. Now, freelance as an alternative career path steadily becomes a reality. 50.9% of the U.S. workforce will be freelancing by 2027, a Statista survey shows. Businesses like Fiverr and fellow gig-focused companies rode the wave. To be more precise, they adopted a model allowing the hire of independent contractors without any legwork. How do such tools set the new trend in powering freelancers? In this article, we share proven methods geared towards freelance website growth. Moreover, you will get a glimpse of how to create a micro-job marketplace like Fiverr of your own.
It’s no secret that the COVID-19 pandemic has led many people to reconsider their jobs. Now, freelance as an alternative career path steadily becomes a reality. 50.9% of the U.S. workforce will be freelancing by 2027, a Statista survey shows.
Businesses like Fiverr and fellow gig-focused companies rode the wave. To be more precise, they adopted a model allowing the hire of independent contractors without any legwork. How do such tools set the new trend in powering freelancers?
In this article, we share proven methods geared towards freelance website growth. Moreover, you will get a glimpse of how to create a micro-job marketplace like Fiverr of your own.
Tags
- How to Create a Micro-Job Marketplace Like Fiverr
- online marketplace development
- micro-job site
- online marketplace
- website like Fiverr
- marketplace development
- custom software
- micro-job marketplace
- Codcia blog
- marketplace website
- cost to build marketplace
- freelance portal
- freelance marketplace
- Ruby on Rails marketplace
- entrepreneurship
- e-markteplace
- custom solution
- two-sided marketplace
- Codica
- Fiverr
- freelance website
- micro-job website
- building marketplace
Annotators
URL
-
- Nov 2021
-
-
How to Choose a Reliable SaaS Application Development CompanyKateCloud & SaaS Product ResearcherDmitryCEOSaaSHomeBlogEntrepreneurshipHow to Choose a Reliable SaaS Application Development CompanyPublishedAug 5, 2020UpdatedAug 5, 202012 min readCurrently, SaaS is the largest segment of the global public cloud services market. The growing SaaS industry provides an equal-opportunity atmosphere for businesses. It concerns enterprises from startups to tech giants – and any size in between. It explains why traditional software companies, like Microsoft and Adobe, decided to look into that direction too. Indeed, the time is ripe for developing a SaaS application now. But however tempting it may be, do not dive in headfirst with launching a SaaS product, because sometimes, it can be very challenging. That is why we have prepared a guide on finding a SaaS application development company that will be your best bet.
Looking to build a SaaS app? You will need help of a reliable development team. Check our advice on how to choose a SaaS development company.
Tags
- SaaS development
- Ruby
- SaaS solutions
- custom software
- SaaS hosting provider
- SaaS
- SaaS MVP
- SaaS pricing
- Ruby on Rails development company
- RoR
- software provider
- Ruby on Rails
- software development
- RoR developers
- Ruby on Rails marketplace
- Ruby on Rails framework
- SaaS App
- software agency
- software company
- SaaS market
- Ruby gems
Annotators
URL
-
-
-
SaaS Product Development: Why Choose Ruby on Rails Framework?KateCloud & SaaS Product ResearcherRuby/RailsSaaSHomeBlogTechnologySaaS Product Development: Why Choose Ruby on Rails Framework?PublishedSep 10, 2020UpdatedSep 10, 202013 min readWhich technology to pick for your SaaS business to succeed? This question is not uncommon in our days. In fact, quite the opposite because the SaaS model has become a meaningful part of every business domain. And the demand for SaaS product development is higher than ever and still increasing. This article will discuss the essential factors you need to consider when selecting a framework for your SaaS project. Also, we will introduce the top 3 frameworks for building a SaaS product with their pros and cons. Read on to see the best examples of SaaS applications.
Choosing the right tech stack can help you save costs and make your app stand out in the saturated market. Let’s discuss why Ruby on Rails can be your best choice.
-
-
-
What Makes Ruby on Rails Perfect for Marketplace Development?AlinaE-Commerce & SaaS StrategistMarketplaceRuby/RailsHomeBlogEntrepreneurshipWhat Makes Ruby on Rails Perfect for Marketplace Development?PublishedJul 13, 2020UpdatedJul 13, 202012 min readThe last several years have been marked with the rise of different marketplaces. Airbnb, AliExpress, Etsy, Booking.com are on everyone’s lips. That's not surprising that the idea of launching a second Amazon or eBay seems so appealing. To win the e-commerce race, entrepreneurs focus on providing excellent customer experience and build fast-loading and scalable websites. Besides, business owners take various security measures to protect their customers’ sensitive information. This way, they can gain clients’ trust and boost sales. When building a custom marketplace, what technology stack is best to achieve all these goals? Our answer is simple: Ruby on Rails. In this article, we will fill you in on the Ruby on Rails marketplace development. At Codica, we are passionate fans of this framework and have built numerous e-commerce platforms with its help. Based on our experience, we will discuss the key reasons to choose RoR for building a successful marketplace.
The last several years have been marked with the rise of different marketplaces. Airbnb, AliExpress, Etsy, Booking.com are on everyone’s lips. That's not surprising that the idea of launching a second Amazon or eBay seems so appealing.
To win the e-commerce race, entrepreneurs focus on providing excellent customer experience and build fast-loading and scalable websites. Besides, business owners take various security measures to protect their customers’ sensitive information. This way, they can gain clients’ trust and boost sales.
When building a custom marketplace, what technology stack is best to achieve all these goals? Our answer is simple: Ruby on Rails.
In this article, we will fill you in on the Ruby on Rails marketplace development. At Codica, we are passionate fans of this framework and have built numerous e-commerce platforms with its help. Based on our experience, we will discuss the key reasons to choose RoR for building a successful marketplace.
Tags
- Ruby
- online marketplace development
- ecommerce
- online marketplace
- programming languages
- marketplace development
- startups
- Ruby on Rails development company
- RoR
- ecommerce website
- Ruby on Rails
- multi-vendor
- RoR developers
- Ruby on Rails marketplace
- Ruby on Rails framework
- e-commerce platform
- Ruby gems
- coding
- gems
- emarketplace
- framework
- e-commerce
- building marketplace
Annotators
URL
-
-
www.amazon.com www.amazon.com
-
1) Order the one for your particular vehicle if you can otherwise the curvature of the side rails may not be correct which will dent the metal once secured.2) Look/feel under the headliner if you can prior to drilling into the roof, you may hit a beam which will be troublesome running a screw through multiple pieces of metal. You can also cut the side rails if necessary.3) Use non-corrosive silicone (does not smell like vinegar which will eventually eat away at the paint and rust) to seal up the holes that you drill into the roof. End caps doesn't appear to make a tight seal.4) Screws are stainless which are typically soft. Be careful not to overnighten! I actually used a rivnut/blind nut tool instead of just screws (About 25 bucks here on Amazon).
-
- Sep 2021
-
- Jul 2021
-
rails.lighthouseapp.com rails.lighthouseapp.com
-
Rails' inability to automatically route my link_to and form_for in STI subclasses to the superclass is a constant source of frustration to me. +1 for fixing this bug.
I've had to work around this by doing record.as(BaseClass)
-
-
stackoverflow.com stackoverflow.com
-
I don't like that I can't really use head? to know it's a HEAD request, but I (think I) understand the reasoning
-
- Jun 2021
-
github.com github.com
-
As you can see Rails already adds error messages from associated models and doing it wrongly: Merging together errors from different models under same has_many association. :"employments.company"=>["can't be blank"] And this is wrong.
-
-
twitter.com twitter.com
-
So ActionCable needs Redis! Is this the first time Rails is aligning with a vendor product? Why not abstract it like AR/AJ?
-
-
disqus.com disqus.com
-
While rails does have nice CSRF protection, in my instance it limited me.
-
-
docs.gitlab.com docs.gitlab.com
-
GitLab is transitioning from controller specs to request specs.
-
- Apr 2021
-
github.com github.com
-
# unauthenticated do # as :user do # root to: 'devise/registrations#new' # end # end
-
# authenticated :user, lambda {|u| u.role == "admin"} do # root to: "admin/dashboard#show", as: :user_root # end
-
-
github.com github.com
-
There is no request.env in functional tests because the functional tests are supposed to remain at the controller level.
-
-
github.com github.com
-
This is a Rails change of behaviour and Rails is not going back.
-
-
github.com github.com
-
class LoggedInConstraint def self.matches?(request) request.env['warden'].authenticate? end end
(have not tried)
-
-
stackoverflow.com stackoverflow.com
-
class AuthConstraint def initialize(&block) @block = block || ->(_) { true } end def matches?(req) user = current_user(req) user.present? && @block.call(user) end def current_user(req) User.find_by_id(session[:user_id]) end end This is a flexible approach to defining route access based on any desired variable (roles, auth, etc...)
Good solution, and might be needed if you want to base routes on roles, etc. — but this one is even easier if all you need is for it to be conditional based on signed in or not (because devise provides authenticated helper):
-
scope module: 'authenticated', constraints: AuthConstraint.new { |user| user.present? } do # Management dashboard root 'dashboards#index' end root 'home#index'
-
-
stackoverflow.com stackoverflow.com
-
authenticated :user do root 'calendars#index', as: :authenticated_root end unauthenticated :user do root 'pages#home', as: :unauthenticated_root end
-
-
guides.rubyonrails.org guides.rubyonrails.org
-
You can also specify constraints as a lambda:
-
- Mar 2021
-
github.com github.com
-
Meh... as I said earlier, I think using Webpack is the recommended way now. Another issue is there is no way to generate source maps in production.
-
But last I have seen comments from DHH, he considered webpack(er) recommended for JS, but Sprockets still the preferred solution for (S)CSS.
-
I agree about lack of maintenance. It's probably because people use more and more Webpack.
Tags
- possible response/reaction to lack of maintainance / maintainer absence/silence
- official preferred convention / way to do something
- switching/migrating to something different
- shift in preference
- switching/migrating from Sprockets to Webpack (Rails)
- webpack
- is anyone even still using it anymore?
- sprockets
- unfortunate that this is no longer maintained
- falling out of favor
- abandoning/migrating away from
Annotators
URL
-
-
github.com github.com
-
we want source maps in production (like DHH)
-
After waiting years for sprockets to support this we were very happy to see that sprockets 4 officially added support (thanks ), but then when trying to upgrade we noticed there's actually no way to use it in production... (without brittle hacks mentioned above).
-
-
-
Rails still encourages you to dump all validation errors at the top of a form, which is lulzy in this age of touchy UX
-
-
trailblazer.to trailblazer.to
-
Run the complete unit with a certain input set, and test the side-effects. This differs to the Rails Way™ testing style, where smaller units of code, such as a specific validation or a callback, are tested in complete isolation. While that might look tempting and clean, it will create a test environment that is not identical to what happens in production.
-
-
github.com github.com
-
Responders don't use valid? to check for errors in models to figure out if the request was successful or not, and relies on your controllers to call save or create to trigger the validations.
-
- Feb 2021
-
github.com github.com
-
Instead of dealing with a mix of before_filters, Rack-middlewares, controller code and callbacks, an endpoint is just another activity and allows to be customized with the well-established Trailblazer mechanics.
-
-
trailblazer.to trailblazer.to
-
The legendary cfp-app will become a Rails-to-TRB refactoring tutorial.
-
To make it short: we returned to the Rails Way™, lowering our heads in shame, and adhere to the Rails file and class naming structure for operations.
-
-
github.com github.com
-
github.com github.com
-
While Trailblazer offers you abstraction layers for all aspects of Ruby On Rails, it does not missionize you. Wherever you want, you may fall back to the "Rails Way" with fat models, monolithic controllers, global helpers, etc. This is not a bad thing, but allows you to step-wise introduce Trailblazer's encapsulation in your app without having to rewrite it.
Tags
- allowing developer/user to pick and choose which pieces to use (allowing use with competing libraries; not being too opinionated; not forcing recommended way on you)
- newer/better ways of doing things
- freedom of user to override specific decision of an authority/vendor (software)
- leaving the details of implementation/integration up to you
- rails: the Rails way
- abstractions
- Trailblazer
- making changes / switching/migrating gradually/incrementally/step-wise/iteratively
- focus on what it should do, not on how it should do it (implementation details; software design)
- focus on concepts/design/structure instead of specific/concrete technology/implementation
Annotators
URL
-
-
macwright.com macwright.com
Tags
Annotators
URL
-
-
github.com github.com
-
By default, hashes remove any keys that aren't given as nested filters. To allow all hash keys, set strip: false. In general we don't recommend doing this, but it's sometimes necessary.
-
ActiveInteraction type checks your inputs. Often you'll want more than that. For instance, you may want an input to be a string with at least one non-whitespace character. Instead of writing your own validation for that, you can use validations from ActiveModel. These validations aren't provided by ActiveInteraction. They're from ActiveModel. You can also use any custom validations you wrote yourself in your interactions.
-
Since we're using an interaction, we don't need strong parameters. The interaction will ignore any inputs that weren't defined by filters. So you can forget about params.require and params.permit because interactions handle that for you.
-
Note that it's perfectly fine to add errors during execution. Not all errors have to come from type checking or validation.
-