This is a little project to see if we can write a tidy underlying framework.
refinery / refinerycms-settings Goto Github PK
View Code? Open in Web Editor NEWExtracted from Refinery CMS
Home Page: http://refinerycms.com
License: MIT License
Extracted from Refinery CMS
Home Page: http://refinerycms.com
License: MIT License
The name of the setting cannot be modified?
This is really not good; Settings is supposed to be used by customers, they don't understand the current title extracted from the configuration key.
What I mean is we need a title property which can be modified for settings.
Index action missing in Refinery::Blog::Admin::SettingsController
getting this:
AbstractController::ActionNotFound (The action 'index' could not be found for Refinery::Blog::Admin::SettingsController):
Hi!
After adding refinerycms-settings to the Gemfile and running bundle install when I try to run rails generate refinery:settings it fails with:
kovacs-davids-macbook:toplamax_web kovacsd$ rails generate refinery:settings
Faraday: you may want to install system_timer for reliable timeouts
/Library/Ruby/Gems/1.8/gems/refinerycms-settings-1.0.5/config/routes.rb:1: uninitialized constant Refinery::Application (NameError)
from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/application/routes_reloader.rb:40:in `load_paths'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/application/routes_reloader.rb:40:in `each'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/application/routes_reloader.rb:40:in `load_paths'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/application/routes_reloader.rb:16:in `reload!'
from /Users/kovacsd/.bundler/ruby/1.8/refinerycms-06cfc2142a62/core/lib/refinery/core/engine.rb:129
from /Library/Ruby/Gems/1.8/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:34:in `call'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:34:in `execute_hook'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:43:in `run_load_hooks'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:42:in `each'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/application/finisher.rb:59
from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/initializable.rb:30:in `instance_exec'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/initializable.rb:30:in `run'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/initializable.rb:55:in `run_initializers'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/initializable.rb:54:in `each'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/initializable.rb:54:in `run_initializers'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/application.rb:136:in `initialize!'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/railtie/configurable.rb:30:in `send'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/kovacsd/devel/toplamax_web/config/environment.rb:5
from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/application.rb:103:in `require_environment!'
from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/commands.rb:25
from script/rails:6:in `require'
from script/rails:6
Thanks
I am pretty new to Ruby and may just be missing something very simple, but would definitely appreciate the help.
I am having an issue adding help text and removing the delete option. I noticed these nifty possibilities on the demo site. Looking at the setting view file I can see the unless statement for the help-info icon (Line 17). The delete icon has a method that references destroyable (Line 15) but I'm still getting output where the demo site is not.
I wanted to make it impossible to delete the Site Name (site_name)
setting.
I first found everywhere the core site name setting was used:
:site_name => Refinery::Core.site_name
and changed it to this:
:site_name => ::Refinery::Setting.get(:site_name)
Then I edited /config/initializers/refinery/settings.rb:
config.find_or_set(:site_name, ::Refinery::Core.site_name, { :destroyable => false })
Along with that failure, all I can deduce about setting help text is the setting_field
method from the settings_helper.rb (Line 16)
2.0.2 is stripping whitespace from settings, 2.0.1 seems fine.
Also having trouble with yaml crashes in 2.0.2, not sure if it's related.
If you need an example let me know.
Hi Philip,
My gemfile is as follows:
# Refinery CMS
gem 'refinerycms', '~> 2.0.3'
gem "refinerycms-settings", "~> 2.0.1"
But I'm getting an 'undefined method' error like so when using ::Refinery::Setting...
undefined method `acts_as_indexed' for #<Class:0x4542b88>
Adding 'acts_as_indexed' to the gemfile works, but shouldn't that be a dependency on this gem then?
Thanks :-)
created setting with:
:Refinery::Setting.find_or_set( :gardenia_parts_sidebar, %w(side_body recent_posts recent_news widgets ) )
viewed and edited once in admin dashboard; shows up as:
---
- side_body
- recent_posts
- recent_news
- widgets
but when accessed programmatically (say, in console):
sidelist = ::Refinery::Setting.get(:gardenia_parts_sidebar)
=> "---\r\n- side_body\r\n- recent_posts\r\n- recent_news\r\n- widgets\r\n- body_content_right\r\n- daily_quotes"
a string, not an array, is returned!
For example:
Try add:
Name: twitter
Value: @parndt
and this leads to:
Psych::SyntaxError in Refinery::Admin::SettingsController#create
(): found character that cannot start any token while scanning for the next token at line 1 column 1
branch: 2-0-stable
I have commented out config.site_name in the initializer, yet I'm still unable to set this through refinerycms-settings. Is this no longer supported?
Hi guys,
I'm getting the following error with 2.0.2 (not 2.0.1) when running an update on a setting on Heroku:
A NoMethodError occurred in settings#update:
undefined method `to_ruby' for #<Syck::Scalar:0x0000000e705310>
vendor/bundle/ruby/1.9.1/gems/refinerycms-settings-2.0.2/app/models/refinery/setting.rb:24:in `block in <class:Setting>'
Let me know if you need a further stack trace or anything.
Thanks!
for example setting property with name test/something
has edit url
/refinery/settings/test/something/edit?app_dialog=true&dialog=true
and that cause error:
NoMethodError in Refinery::Admin::BaseController#error_404
undefined method `action' for Refinery::Admin::BaseController:Module
I have an issue when update a refinery settings value in admin page and it only reflects until restart server
class AdminMailer < ApplicationMailer
default to: "#{Refinery::Setting.find_or_set(:admin_email, "[email protected]", scoping: "mailer")}", from: "[email protected]"
def notify_to_admin(email, saving_up_information)
# code here
end
end
my admin_email from default to always get old value so is there a way to take effect this change without restart server?
Any help?
This is probably not the main usage for find_or_set
but invoking
::Refinery::Setting.find_or_set(:setting_key, nil)
will issue a write operation on the database even if a setting exists for the provided key.
Putting the above find_or_set
call in views will cause nested transactions that are not supported by some databases (eg. Sqlite3).
My suggestion is to rely on ::Refinery::Setting.find_or_create_by_name(key) when the value readed from cache and the value argument passed to find_or_set
are both nil
I think a seed with the RefineryCMS configurable settings would be appreciated... to me, at least :)
When I used refinerycms-inquiries
I had to specify in my gemfile :
gem 'refinerycms-settings', :git => 'git://github.com/refinery/refinerycms-settings.git'
A version 2.1.0 should exist to be able to use :
gem 'refinerycms-settings', '~> 2.1.0'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.