huacnlee / rails-settings-cached

Global settings for your Rails application.
Other
1.06k stars 202 forks source link

getting an undefined method for a setting #212

Closed andreas-it-dev closed 3 years ago

andreas-it-dev commented 3 years ago

Hi, the whloe thing was working flawlessly until today, where i added a new Setting.. that results in a weird error:

image

as you can see, the console underneath has perfect knowledge of the setting the view above complains about..

my Setting model looks like this:

class Setting < RailsSettings::Base
  cache_prefix { "v1" }

  field :signin_redirect_target, default: "", type: :string
  field :admin_email, default: "adam@traderskew.com"
  field :default_tweet_text, default: "There is a new post for your you waiting on traderskew!"
  field :status_content, default: ""
  field :charities_enabled, default: "0", type: :boolean
  field :charities_total_enabled, default: "0", type: :boolean
  field :subscriptions_enabled, default: "0", type: :boolean
  field :blog_enabled, default: "0", type: :boolean
  field :status_enabled, default: "0", type: :boolean
  field :adjust_donation_amount_by, type: :float, default: 0.0
  field :visible_blog_posts, type: :integer, default: 3
  field :show_crypto_payments, default: "0", type: :boolean
  field :crypto_payments_content, default: ""
end

when i remove the signin_redirect_target it is all back working again.

is there anything i do wrong?

thanks, Andreas

huacnlee commented 3 years ago

I can't found any issue in your message, would you please add the admin/settings.html.erb file content?

andreas-it-dev commented 3 years ago

hi! sure, thx for looking into this!

made a zip from the view plus the nav partial which is part of the view..

settings.zip

huacnlee commented 3 years ago

I found this issue, the form select can't support in current.

I will try to fix it, you can switch to write <select> without ActionView helper

andreas-it-dev commented 3 years ago

ah, nice, thanks @huacnlee ! will give it a shot with html then..

huacnlee commented 3 years ago

version 2.6.0

andreas-it-dev commented 3 years ago

@huacnlee - thats awesome, thanks so much, that fixed it!