PaperTrail
view_component
Our great sponsors
PaperTrail | view_component | |
---|---|---|
18 | 74 | |
6,697 | 3,148 | |
0.5% | 1.3% | |
5.9 | 9.0 | |
3 months ago | about 16 hours ago | |
Ruby | Ruby | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
PaperTrail
-
historical data and "point in time" data modeling techniques, advice.
if the source (web) application makes their own audit tables. ex: our ruby on rails application uses the paper-trail gem
-
Best rails tools to automatically handle logging of things like all a user's actions, or changes to a record in a module - primarily for audit purposes.
Start with https://github.com/paper-trail-gem/paper_trail
-
Inventory/Sales Management module built on a Rails app - what would be the best way to "version" updates made against an SKU.
We use paper_trail for this
-
is there a gem for tracking adhoc rails console changes
I think you could use that in conjunction with the paper_trail gem, as /u/GreenCalligrapher571 mentioned, which is also a good suggestion. As an additional note, when changing records in production while using the paper_trail gem, I suggest wrapping your database-mutating statements executed in the rails console within a whodunnit block, so PaperTrail.request(whodunnit: 'Dorian Marié') { widget.update name: 'Wibble' } or something rather than just widget.update name: 'Wibble'. Or, if you have some sort of issue-tracking / ticketing system, you could set the whodunnit value to the ticket number or whatever, and then anyone who wants to know why the records are in the state they're in can consult that ticket, which hopefully has additional relevant context.
-
History Tracking With Postgres
For a while we did this using the paper-trail gem. This was a very simple way to add a few lines of code to keep track of all of the changes made to an ActiveRecord model. But it came with one drawback. Every change to the data had to be done through ActiveRecord. There are often times when this makes an app vulnerable to a race condition. I’ll use a contrived example so as not to share any real code from our client’s app.
-
Adding soft delete to a Phoenix Commanded (CQRS) API
In most designs, this would probably not be possible unless a table tracking extension is being used in an ORM. Even with change tracking enabled through extensions like paper trail or Django simple history, it can be tricky to restore deleted entities. Object tracking would need to have been enabled before it is needed to ensure the data is still around to be restored.
- Looking for a Rails Gem that Audits Manual Database Changes
-
Temporality/time-travelling in DB with ActiveRecord?
Maybe you are looking for the papertrail gem? https://github.com/paper-trail-gem/paper_trail
- Looking for an observer gem
view_component
- Things I wish I knew before moving 50K lines of code to React Server Components
-
Supercharged table component built with ViewComponent
When searching for examples of table components built with the ViewComponent gem, I was surprised to find none. After some inquiries, I came across examples that worked like this:
-
More expressive APIs for View Components
View components offer two primary ways to interact with the component: passing arguments to the initializer and using slots:
- Have you been using ViewComponent. What advantages do you see in it?
-
How can I integrate VueJS into a rails 7 application? What is the workflow?
For example, splitting out views into partials? Or the new ViewComponent feature that's becoming quite popular - https://viewcomponent.org/
- Helpers vs Components
-
Vanilla Rails view components with partials | Stanko K.R.
I used to do "pure ruby" approach to that -- but basically wound up realizing I was re-inventing github's view_component. Their design goals were similar enough to what I was trying to do, that it made more sense just to use that, rather than try to re-invent it myself.
-
Gnarly Learnings from March 2023
ViewComponent
- Os benefícios de componentizar as views do Rails
-
Does anyone kind of miss simpler webpages?
The linked one is my Rails implementation, written for ViewComponent. The official version uses Nunjucks.
What are some alternatives?
Audited - Audited (formerly acts_as_audited) is an ORM extension that logs all changes to your Rails models.
Stimulus - A modest JavaScript framework for the HTML you already have
Paranoia - acts_as_paranoid for Rails 5, 6 and 7
turbo-rails - Use Turbo in your Ruby on Rails app
Logidze - Database changes log for Rails
Tailwind CSS - A utility-first CSS framework for rapid UI development.
mongoid-history - Multi-user non-linear history tracking, auditing, undo, redo for mongoid.
cypress-rails - Helps you write Cypress tests of your Rails app
ActsAsParanoid - ActiveRecord plugin allowing you to hide and restore records without actually deleting them.
hotwire-rails - Use Hotwire in your Ruby on Rails app
Discard - 🃏🗑 Soft deletes for ActiveRecord done right
i18n-tasks - Manage translation and localization with static analysis, for Ruby i18n