Partials for personal preferences

18 views
Skip to first unread message

Sam Whited

unread,
Aug 2, 2012, 11:25:12 PM8/2/12
to Radiant CMS: Dev
Hi all:

I'm working on an extension that needs to add to the personal
preference and users edit interfaces.

I've got a partial ready (the same one will be used for both
interfaces), and have added the following to my activate method:

```
admin.users.edit.add :form, 'admin/preferences/two_factor_edit',
:after => 'edit_password'
admin.preferences.edit.add :form,
'admin/preferences/two_factor_edit', :after => 'edit_password'
```

The partial is rendered in the user edit view fine, but when I add the
second line (user preferences) Radiant starts throwing:

undefined method `preferences' for #<Radiant::AdminUI

Everything else seems to refer to preferences as admin.preferences, so
I have a feeling I'm missing something blatantly obvious.

Any ideas?

—Sam

--
Sam Whited
pub 4096R/EC2C9934

SamWhited.com
s...@samwhited.com
404.492.6008

Jim Gay

unread,
Aug 7, 2012, 3:07:05 PM8/7/12
to radiant...@googlegroups.com
Strange. Which version of Radiant are you using?

--
Write intention revealing code #=> http://www.clean-ruby.com

Jim Gay
Saturn Flyer LLC
571-403-0338

Sam Whited

unread,
Aug 7, 2012, 3:23:53 PM8/7/12
to radiant...@googlegroups.com
On Tue, Aug 7, 2012 at 3:07 PM, Jim Gay <j...@saturnflyer.com> wrote:
> Strange. Which version of Radiant are you using?
>

Oops, this is 1.0.1 pre.

Sam Whited

unread,
Aug 8, 2012, 5:10:23 PM8/8/12
to Radiant CMS: Dev
On Thu, Aug 2, 2012 at 11:25 PM, Sam Whited <s...@samwhited.com> wrote:
> admin.preferences.edit.add :form,
> 'admin/preferences/two_factor_edit', :after => 'edit_password'

Wow, after all that, I sat down today and realized that I was using
`admin.preferences.edit' when the actual name is
`admin.user.preferences'. Obviously I need an extra pair of eyes.

Sorry for the time waster.
Reply all
Reply to author
Forward
0 new messages