Using rails_admin gem, I want to create a clickable link to rails_admin dashboard's left hand side bar.
Path of that link should be according to the rails path. I don't want to add any model for the same.
Please help me in adding the link.
You can add in your rails admin initializer:
config.navigation_static_links = {
'Dashboard' => '/admin' #or whatever you used to mount RailsAdmin in your routes file
}
Related
I have a django site onto which I have added wagtail following these instructions.
I have set up Social Media setting using these instructions
I have sucessfully added details on the admin page ad I can return and edit these details
However I cannot access them in a template
If I display
{{settings.site_settings.SiteSettings.facebook}}
I get '' (tested using {% if settings.site_settings.SiteSettings.facebook == '' ...)
However
{{settings.site_settings.SiteSettings}}
returns None
and
{{settings.site_settings}}
returns SettingsModuleProxy(site_settings)
What am I doing wrong?
The problem was simply that I had misspelt the SiteSettings class name in models.py (very red-face)
I am using devise as an authentication solution for my rails4 app and want to use recaptcha when user signs up but don't know how to do this.
Try following the directions here: https://github.com/plataformatec/devise/wiki/How-To:-Use-Recaptcha-with-Devise
Get your keys from Google/Recaptcha
Install the Recaptcha gem found
here (note: for Rails 3 do gem 'recaptcha', :require =>
'recaptcha/rails')
Add <%= recaptcha_tags %> on your New
Registration view (you must have generated Devise views) the line
before your submit button.
Create/Update your
RegistrationsController - see the "controllers" section in the
README to understand how to set up your own devise controllers. Remember that "devise" expects you to use flash[:notice] and flash[:alert] and not flash[:error].
Don't forget to update the routes once you do.
I have a rails controller page home_controller.rb
class HomeController < ApplicationController
def index
##users = User.all
#loan_applications = LoanApplication.all
end
def button_listing_show
redirect_to lp_banker_assignments_path
end
end
And I have this Rails Slim button code
button Go to Listings onclick="<%home.button_listing_show%>"
What i want is on the onclick events the page redirects to this path.
Can someone provide an answer for me either in Slim or in Rails.
Thanks
button Go to Listings onclick="#{lp_banker_assignments_path}"
You are just generating a path with that function, so why not just interpolate to the path directly?
Docs for variable interpolation
Used firebug and inspected Spree default logo is coming from
/assets/store/logo.png
Checked in spree 2.1.3 Version Source code and found default logo is coming from /logo section.
path :
core/app/models/spree/app_configuration.rb
preference :logo, :string, default: 'logo/spree_50.png'
Trying to Override, the default logo using Spree:Config option.
Spree::Config.set(logo: "store/logo.png")
But it's still redirecting to the old image(spree_50.png) and I am unable to replace the default logo.
In application.rb:
Spree.config do |config|
# Example:
# Uncomment to override the default site name.
# config.site_name = "Spree Demo Site"
config.logo = "logo.png"
end
Then add your logo to public/images/ and the logo will show up.
You can place your image at this path.
Inside: app/assets/images/logo/"Your Image"
for eg. app/assets/images/logo/hi5_logo.png**
Inside: config/initializers/spree.rb
Spree.config do |config|
config.logo = "logo/hi5_logo.png" #for default store logo
config.admin_interface_logo = "logo/hi5_logo.png" #for admin logo
end
Where did I miss to add a line of code if I try to echo php variable inside OPENCART product.tpl file and it doesn't show up on site?
Notes: there is a field in database. I am able to save to this field from admin panel ( i added a custom field there).
Did You edit also the product controller to load the variable and pass it to the template? I guess not... Edit catalog/controller/product/product.php and add $this->data['MYVARIABLE'] = $product_info['MYVARIABLE']; somewhere before $this->render() is called.