Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 4: site_title_image #2646

Closed
shlima opened this issue Nov 3, 2013 · 9 comments
Closed

Rails 4: site_title_image #2646

shlima opened this issue Nov 3, 2013 · 9 comments

Comments

@shlima
Copy link

shlima commented Nov 3, 2013

Hello.

As we know, Rails 4 has no longer generates no-digest versions of assets. So how can I use config.site_title_image with assets pipeline?

Thanks.

@seanlinsley
Copy link
Contributor

It looks like you have options: [1] & [2].

As far as what the suggested workflow should be for Active Admin, I'm open to suggestions.

@igorbernstein
Copy link
Contributor

@shlima how are you assigning config.site_title_image? I'm away from computer but I'm pretty sure the digests are added if you use a relative path:

Ie. for app/assets/images/logo.png, try
config.site_title_image = "logo.png"

@shlima
Copy link
Author

shlima commented Nov 4, 2013

@igorbernstein thanks, this works. I was confused because of comment line contains:

  # Set an optional image to be displayed for the header
  # instead of a string (overrides :site_title)
  # config.site_title_image = "/images/logo.png"

So the config.site_title_image = 'logo.png' variant works fo me.

@igorbernstein
Copy link
Contributor

I'm guessing thats a carry over from pre-asset pipeline days.
The generator template should be updated, and maybe the doc can be made more explicit
http://www.activeadmin.info/docs/1-general-configuration.html#site_title_options

@seanlinsley
Copy link
Contributor

I just updated the initializer, but I'm not sure how the docs could be made more clear

@igorbernstein
Copy link
Contributor

Documentation is definitely not a skill I possess, but how about something like:

Every page has what's called the site title on the left side of the menu bar. If you want, you can customize it. The site_title_image setting can either be an absolute or relative path

config.site_title       = "My Admin Site"

# use /assets/site_image-DIGEST.png
config.site_title_link  = "site_image.png"

# use /images/site_image.png
config.site_title_image = "/images/site_image.png"

@seanlinsley
Copy link
Contributor

Will the scoped version actually work, though?

@igorbernstein
Copy link
Contributor

you'd use the absolute version if you wanted to reference an image in /public, now that I think about it, you'll never wanna do that.

maybe this?

Every page has what's called the site title on the left side of the menu bar. If you want, you can customize it. The site_title_image setting can either be an absolute or relative path

config.site_title       = "My Admin Site"

# use /assets/site_image-DIGEST.png
config.site_title_link  = "site_image.png"

# use external image
config.site_title_image = "http://www.google.com/images/logos/google_logo_41.png"

@seanlinsley
Copy link
Contributor

Good enough 🐙

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants