Why not just redirect to the Radiant page and let Radiant do the rendering part?
def show
if @site_user.license
redirect '/subscriber'
else
redirect '/some-other-page'
end
end
On Sat, Aug 6, 2011 at 6:51 PM, Susan Javurek <[email protected]> wrote:
> Hi,
>
> My sidebars weren't showing so I added variables to my controller,
> e.g. " @sidebar_text = subscriber_page.render_part(:sidebar)" and then
> in my view code "<%= @sidebar_text %>". Is there a better way?
>
> Thanks,
> Susan
>
> On Aug 6, 11:43 pm, Wesley Gamble <[email protected]> wrote:
>> What was the problem Susan?
>>
>> Sent from my iPhone
>>
>> On Aug 6, 2011, at 5:40 PM, Susan Javurek <[email protected]> wrote:
>>
>>
>>
>>
>>
>>
>>
>> > Hi,
>>
>> > I figured this out.
>>
>> > Thanks,
>> > Susan
>>
>> > On Aug 1, 5:26 pm, Susan Javurek <[email protected]> wrote:
>> >> Hi,
>>
>> >> I have a very simple question regarding a custom controller. My
>> >> controller does a check on the user id and depending on the result
>> >> displays one page or another. The pages are all created in the
>> >> radiant editor. It's all working great but I don't see my sidebars:
>>
>> >> ....
>>
>> >> class SupportController < UserApplicationController
>> >> ....
>> >> if not @site_user.license.nil?
>> >> @page_text = get_subscriber_page
>>
>> >> ...
>> >> def get_subscriber_page
>>
>> >> subscriber_page = Page.find_by_slug("subscriber")
>> >> # subscriber_page = Page.find_by_url("/subscriber")
>> >> if subscriber_page
>> >> begin
>>
>> >> subscriber_page.render_part(:body) ***
>>
>> >> rescue StandardError => e
>> >> logger.error("Failed to render the subscription page. " +
>> >> "Error: #{e.class} #{e.message}. Full description:
>> >> \"#{self.full_description}\"")
>> >> return nil
>> >> end
>> >> else
>> >> logger.warn("The path to the 'subscription-center' slug does
>> >> not exist.")
>> >> return nil
>> >> end
>> >> end
>>
>> >> ...
>>
>> >> As you can see I use page.render_part (***) which returns the body and
>> >> only the body. How can I render the sidebars (I have 4) and the body?
>> >> I've tried just plan "render()" but this doesn't work at all. My view
>> >> (index.rhtml) has "<%= @page_text %>".
>>
>> >> Kindest regards,
>> >> Susan
>