creamy-ghost-62907
01/25/2023, 9:12 PMcreamy-ghost-62907
01/25/2023, 9:12 PMcreamy-ghost-62907
01/25/2023, 11:08 PMArgumentError: Missing secret_key_base for 'prod' environment, set this string with bin/rails credentials:edit
<-- So now I'm getting this in CI. And, it appears to be the case that Turbo-Rails wants some environment-specific config stuff at asset precompilation time. OOC, does anyone here happen to know of a good way to avoid the need for this or am I just gonna be stuck making some use of Rails' encrypted credential store for stuff like this?creamy-ghost-62907
01/26/2023, 12:35 AMrhythmic-summer-83393
01/26/2023, 1:14 AMcreamy-ghost-62907
01/26/2023, 3:10 AMgreat-optician-87198
01/26/2023, 12:42 PMDojos
namespace Dojos::Level
and Dojos::Step
with a one to many relation ship (level has many steps)
Initially I tried to create a avo/resource/dojos/level_resource.rb
but read in the doc that name space are not supported yet for resources.
So I have the following Avo resources
class DojosLevelResource < Avo::BaseResource
...
self.model_class = "::Dojos::Level"
field :dojos_steps, as: :has_many, use_resource: "DojosStep"
...
end
and
class DojosStepResource < Avo::BaseResource
...
self.model_class = "::Dojos::Step"
field :dojos_level, as: :belongs_to
...
end
When I try to create a new Step I have an error (screen capture). For belongs_to is there something similar to use_resource
that I should use ?swift-businessperson-84139
01/31/2023, 3:13 AMhas_one_attached :profile_image
to your model and then field :profile_image, as: :file, accept: "image/*"
in the resource. After following Rails steps (active storage, image processing) in the documentation, of course. I think I did all of that, and it's not working for me for some reason. Any advice? The exciting part is that I'm not getting any errors. I can see the show page does the right query but the edit page does not allow me to enter the image.mammoth-guitar-49791
01/31/2023, 1:58 PMVite
and Propshaft
? I have an app currently running with this set up in order to get live reloading, but realized that all the avo assets are no longer working.swift-businessperson-84139
02/02/2023, 3:50 AMtime_zone_select
in select fields? I'm trying to add a dropdown so the user can pick his timezone from UI. Something like field :time_zone, as: :time_zone_select
would be nice.millions-waiter-75292
02/05/2023, 2:45 PMresolve_query_scope
and resolve_find_scope
etc. for fetching, but how could I ensure that a model is created with a default?
Note that I'm just starting out here - and frankly, didn't start yet using Pundit, which could also solve this, but was wondering what the "low level" solution was. Thanks a lot!nutritious-table-76971
02/06/2023, 1:36 PMquaint-pencil-2979
02/06/2023, 2:00 PMActionView::Template::Error (Invalid #<UserPolicy> constructor is called):
i do not need this authorization:
I my sidebar extra is there this code line, how i can get all resources without policy scopes?
# _sidebar_extra.html.erb
items = Avo::App.resources_for_navigation(_current_user).each
narrow-laptop-54609
02/06/2023, 8:31 PMfield :published_date, as: :date, required: true, sortable: true, picker_format: 'F d, Y', format: "DD", default: Date.current, placeholder: Date.current
locally it shows the current date just fine, so today, Feb 6 2023, but on the production site, the date shown is Jan 31, 2023. I checked the server shows the same date. What's going on?narrow-laptop-54609
02/06/2023, 8:32 PMnarrow-laptop-54609
02/06/2023, 8:33 PMmelodic-toddler-97877
02/10/2023, 5:50 PMlate-cartoon-17585
02/10/2023, 9:23 PMclass FactoryResource < Avo::BaseResource
self.title = :name
self.includes = []
# self.search_query = -> do
# scope.ransack(id_eq: params[:q], m: "or", product_cont: params[:q], from_measure_unit_cont: params[:q], to_measure_unit_cont: params[:q]).result(distinct: false)
# end
field :id, as: :id
field :internal_code, as: :text
field :name, as: :text
tabs do
field :products, as: :has_many, through: :product_factory
end
end
late-cartoon-17585
02/11/2023, 12:05 AMorange-dusk-17335
02/11/2023, 12:05 AMlate-cartoon-17585
02/11/2023, 1:26 AMhas_many :from_product_conversions, class_name: "ProductConversion", foreign_key: :id_measure_unit_from
has_many :to_product_conversions, class_name: "ProductConversion", foreign_key: :id_measure_unit_to
tabs do
field :from_product_conversions, as: :has_many, translation_key: 'avo.field_translations.from_product_conversions'
field :to_product_conversions, as: :has_many, translation_key: 'avo.field_translations.to_product_conversions'
end
it only translated part of the text, as you can see in Conversรตes origem
, but not the tab titlelate-cartoon-17585
02/11/2023, 1:29 PMlemon-wall-20836
02/13/2023, 1:36 PMlemon-wall-20836
02/13/2023, 1:37 PMswift-businessperson-84139
02/14/2023, 4:50 AMavo:tool
but I'm not sure how to render the submit button (same look as in avo). Can anyone here point me in the right direction? I was looking at the documentation but couldn't find a full example.curved-father-82134
02/14/2023, 2:52 PMActive storage
gem.
I have this`has_many_attached :attachments` in my model which is working fine.
I'm using this field :attachments, as: :files, html: {edit:{....}}
and self.includes = []
I haven't included any assassination in includes array
. In short all good here as well.
but the issue that I'm facing which is about eager loading. Can anyone know about this issue how I can skip this eager loading.
I would be very grateful if anyone could help.๐billowy-easter-81499
02/15/2023, 11:55 PMbin/rails generate avo:action reactivate_client
class ReactivateClient < Avo::BaseAction
self.name = "Reactivate client"
# self.visible = -> { view == :show }
def handle(**args)
models, fields, current_user, resource = args.values_at(:models, :fields, :current_user, :resource)
models.each do |model|
succeed 'Done!'
reload
end
end
end
I registered the action on the ClientResource where users will invoke it from. I am also using pundit and set act_on? to true.
Do I need to register this action elsewhere? Perhaps I am not managing it in pundit correctly? Thanks!boundless-artist-39401
02/16/2023, 2:04 PMstraight-pager-31449
02/17/2023, 3:11 AMcurved-father-82134
02/17/2023, 1:19 PMfield :user, as: :belongs_to
which shows all the ids. But i wanna show the first_name
, name as text id as value.
I would be very grateful if anyone could help.