BL 3.2 and the new style of configurations

20 views
Skip to first unread message

Molly Pickral

unread,
May 1, 2012, 4:16:49 PM5/1/12
to blacklight-...@googlegroups.com
I'm trying to implement per-controller configs with BL 3.2.

I have my CatalogController set up the way I want it, but I have a
different controller where I want to implement separate settings. For
example, in console, I do:

class MyController < ApplicationController
include Blacklight::Configurable
configure_blacklight do |config|
config.add_sort_field 'popularity', :label => 'Relevancy'
config.add_sort_field 'scdate', :label => 'Date'
end
end

Based on this, I would expect this:

MyController.config.sort_fields.inspect

to return only the sort fields for popularity and scdate, but what I
get instead is all of the sort fields from my CatalogController plus
these two fields.

What am I missing? I thought per-controller meant I could do them,
well, per-controller.

Molly

Chris Beer

unread,
May 1, 2012, 5:13:32 PM5/1/12
to blacklight-...@googlegroups.com
This was a bug fixed in 3.3.0 (see
https://github.com/projectblacklight/blacklight/commit/47cf614ec21f259539feb531c7f9915a60260353).
If you can update to Blacklight 3.3 (or, even better, 3.4), I'd
recommend that. I wouldn't be opposed to making a new BL 3.2.x release
with this commit, though.

You might be able to work around this too.. Maybe something like (untested!):

class MyController
blacklight_config = Blacklight::Configuration.new
configure_blacklight do |config|
...
end
end

Chris
> --
> You received this message because you are subscribed to the Google Groups "Blacklight Development" group.
> To post to this group, send email to blacklight-...@googlegroups.com.
> To unsubscribe from this group, send email to blacklight-develo...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/blacklight-development?hl=en.
>
Reply all
Reply to author
Forward
0 new messages