* Redirect /internal to /internal/articles avoiding annoying 404 * Set the navbar on two rows * Add :main_social_image to SiteConfig and to the internal view * Add simple tests * Ameliorate the UI
19 lines
513 B
Ruby
19 lines
513 B
Ruby
class Internal::ConfigsController < Internal::ApplicationController
|
|
layout "internal"
|
|
|
|
def show; end
|
|
|
|
def create
|
|
config_params.keys.each do |key|
|
|
SiteConfig.public_send("#{key}=", config_params[key].strip) unless config_params[key].nil?
|
|
end
|
|
redirect_to internal_config_path, notice: "Site configuration was successfully updated."
|
|
end
|
|
|
|
private
|
|
|
|
def config_params
|
|
# put this stuff in the policy or in the model
|
|
params.require(:site_config).permit(:main_social_image)
|
|
end
|
|
end
|