Questions tagged [trailblazer]

Trailblazer is a thin layer on top of Rails. It gently enforces encapsulation, an intuitive code structure and gives you an object-oriented architecture.

Trailblazer gives you a high-level architecture for web applications. It extends the basic MVC pattern with new abstractions. Rock-solid conventions that go far beyond database table naming or route paths let you focus on your application code, minimize bugs and improve the maintainability.

https://github.com/trailblazer/trailblazer

61 questions
1
vote
1 answer

Rails link do not work in Trailbalzer::cell

I am using cell to render Navigation Bar for current_user devise. But went i try to render page i get an error. I am using rails 7 and ruby 3.0.2 Error undefined method `new_user_session_path' for #
1
vote
0 answers

Scrape Trailblazer.me badges and points

Hi I'm looking for a way to scrape badge and point numbers from Trailblazer. Here is the code I am currently using, based off another stackoverflow post I found. ` const puppeteer = require("puppeteer"); const cheerio = require("cheerio"); const…
1
vote
2 answers

error installing npm install @salesforce/sfdx-lwc-jest --save-dev

I'm unable to install this, Jest Testing Framework setup please help me with is issue Terminal:-> PS C:\Users\Akhilesh\Documents\GitHub\test-lwc> npm install @salesforce/sfdx-lwc-jest --save-dev npm ERR! code ETARGET npm ERR! notarget No matching…
Akhilesh
  • 11
  • 2
1
vote
2 answers

Trailblazer parsing data before validation by :populator

So I have my reform object, and I want to parse my string data before validation, to be able to use dry-validation required(:my_field).filled(gt?: 0) In order to do that I use populator property :membership_fee, populator: MyPopulator My…
Adam Piotrowski
  • 674
  • 1
  • 7
  • 15
1
vote
1 answer

Trailblazer Operation Contract validate the model after manipulation

I have a model with amount parameter that have to be greater than zero. My form asks a user for a number to subtract from the model's amount. How do I validate my model after subtracting the number from amount? Example: right now the amount is 50.…
Nadiya
  • 1,421
  • 4
  • 19
  • 34
1
vote
1 answer

Checkboxes for has_many through, with additional join table attribute

I have a has_many :through association between some models, which determine which datasets are visible on certain dashboards. class Dashboard < ActiveRecord::Base has_many :dashboard_datasets has_many :datasets, :through =>…
SirRawlins
  • 494
  • 3
  • 18
1
vote
1 answer

Namespaced class references inside other classes generate uninitialized constant errors

in my Rails app I'm making liberal use of class namespacing like so: class Person class PrimaryEmailAddress class Update < Trailblazer::Operation def persist(options, **) Shared::Property::HasOne::Update.( …
John
  • 9,249
  • 5
  • 44
  • 76
1
vote
1 answer

Trailblazer cells in the Rails console

How can I work with a Trailblazer cell in the Rails console? The concept helper doesn't work irb(main):002:0> c = concept(Resource::Cell, l) NoMethodError: undefined method `concept' for main:Object Did you mean? concern context …
port5432
  • 5,889
  • 10
  • 60
  • 97
1
vote
1 answer

Rails Trailblazer Reform: `initialize': uninitialized constant Uber::Options (NameError)

Im trying to get Trailblazer-Rails to work in my rails project. But there seem to be some weird things going on with the reform gem. I cant start rails with "rails s". It responds with the error:…
Björn Grunde
  • 55
  • 1
  • 9
1
vote
1 answer

Validation of a set value with Reform

On attempting to extract the validation, I'm trying to use a Object Form, so, I found reform. But I have a model with enum type. How can I validate this value on Reform?
1
vote
0 answers

Undefined Method 'class_builder' for Create::Class, no changes to code?

I was following along the Trailblazer book to learn me some Trailblazer. Yesterday, all my tests were green. Today, I tried to add the rails-timeago helper today, which I had a little bit of troubles with, but I ultimately managed to fix. After I…
Magnaillusion
  • 65
  • 2
  • 10
1
vote
1 answer

How do I validate nested attributes using reform + dry-validation?

Validations are triggered and work as expected for attributes of the record I'm passing in (i.e required(:title).filled), but not for attributes of nested models (i.e required(:name).filled in artist). class AlbumForm < Reform::Form property…
Lorentz Lasson
  • 885
  • 8
  • 26
1
vote
2 answers

get all records via operation and show in view

I have trouble with trailblazer when setting up a simple show all Things view. operation class Thing < ApplicationRecord class ShowAll < Trailblazer::Operation include Model model Thing, :all #why :all is not working here? def…
Dude
  • 1,045
  • 2
  • 15
  • 36
1
vote
0 answers

Trailblazer Reform: validation_groups crashing

I'm setting up a deployment of Trailblazer, however I'm a new Rails user and I could use a little direction about this problem. I've installed all the required Gems, however the Reform gem, is not running properly and it's throwing an error. …
Liam Hogan
  • 324
  • 4
  • 13
1
vote
0 answers

Trailblazer Rails React - How can I call 'concep' from .jsx?

Inside a .JSX, I want to call <%= concept('thing/cell',@operations).(:form) %> , in order to display in the same JSX the view-form.How can I do it? I think it's not possible to use Rail inside a JSX. Thanks! var x = React.createClass({ ...., …
user3529582
  • 165
  • 2
  • 11