Ruby on Rails Sunday, April 24, 2016

Hi,

I am facing the error msg mention in subject, and my theme doesn't
change.

*** init.rb ********
require File.join(File.dirname(__FILE__), "lib", "fedena_theme")
FedenaPlugin.register = {
:name=>"fedena_theme",
:description=>"Fedena Theme"
}

******* /// the line 52 in init.rb showing error /////////////****
52. current_theme =
ActiveRecord::Base::Configuration.get_config_value "Color"




*****fedena_theme.rb **********
# TestPlugin
require 'action_view/helpers/asset_tag_helper'

class FedenaTheme
COLORS = {1 => {:color => "#701288",:accent_color =>
"#4e0d5f",:border_color => "#8d41a0",:sort_order => 16},
2 => {:color => "#39a6ef",:accent_color =>
"#2874a7",:border_color => "#61b8f2",:sort_order => 24},
3 => {:color => "#006290",:accent_color =>
"#004465",:border_color => "#3381a6",:sort_order => 26}
}
FONTS ={1 =>{:text => "Arial", :value => "Arial"},2 =>{:text =>
"Verdana", :value => "Verdana, Arial"},3 =>{:text => "Comic Sans MS",
:value => "Comic Sans MS, Arial"},4 =>{:text => "Georgia", :value =>
"Georgia, Times new Roman"},5 => {:text => "Times new Roman", :value =>
"Times new Roman"},6 => {:text => "Trebuchet MS", :value => "Trebuchet
MS, Arial"},7 => {:text => "Garamond", :value => "Garamond, Times new
Roman"}}
unloadable

def self.general_settings_form
"configuration/theme_select"
end

def self.available_themes
directory = "#{Rails.public_path}/themes"
themes = Dir.entries(directory).select {|entry| File.directory?
File.join(directory,entry) and !(entry =='.' ||
entry == '..') }
return [['Default', 'default']]+themes.collect { |theme|
[theme.titleize, theme] }
end

def self.selected_theme
Configuration.get_config_value("Color")
end


def self.selected_color_value
val = selected_theme
COLORS[val.to_i][:color]
end

end


********* Errors showing
/vendor/plugins/fedena_theme/init.rb:52: warning: toplevel
constant Configuration referenced by ActiveRecord::Base::Configuration


Please help, I dont understand the error and how to resolve this. I
upgraded my App from Rails 2.3.5 to 2.3.10

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/ce89f0afdc1275b0366e8e4a5d57d7a4%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment