[Radiant] Re: Need advice: NoMethodError (undefined method `authenticate' for #

2011-03-09 Thread Shanison
authenticate is one of the class method in 'User' model for Radiant.
Make sure that you didn't modify the original source of the 'User'
model. Or else, you should check what extensions that you have
installed to check the possibility that it has overwrite this User
model.

On Mar 10, 2:26 pm, Dmitry Belitsky  wrote:
> Hello, I can't login on the one of our site more.
> It show me application error when I try to log in.
> Please advice me what I can do to resolve this issue.
> Thanks a lot!
>
> Log file:
>
> Processing Admin::WelcomeController#login [POST]
>   Parameters: {"action"=>"login",
> "authenticity_token"=>"FWUgEe7WTxcXHD1xoLufxhhlWMXrOW0=",
> "controller"=>"admin/welcome", "user"=>{"password"=>"[FILTERED]",
> "login"=>"admin"}}
>
> NoMethodError (undefined method `authenticate' for # 0xb7708250>):
>   radiant (0.8.1) app/controllers/admin/welcome_controller.rb:13:in
> `login'
>   radiant (0.8.1) vendor/plugins/haml/rails/./lib/sass/plugin/rails.rb:
> 19:in `process'
>   thin (1.2.5) lib/thin/connection.rb:76:in `pre_process'
>   thin (1.2.5) lib/thin/connection.rb:74:in `catch'
>   thin (1.2.5) lib/thin/connection.rb:74:in `pre_process'
>   thin (1.2.5) lib/thin/connection.rb:57:in `process'
>   thin (1.2.5) lib/thin/connection.rb:42:in `receive_data'
>   eventmachine (0.12.10) lib/eventmachine.rb:256:in `run_machine'
>   eventmachine (0.12.10) lib/eventmachine.rb:256:in `run'
>   thin (1.2.5) lib/thin/backends/base.rb:57:in `start'
>   thin (1.2.5) lib/thin/server.rb:156:in `start'
>   thin (1.2.5) lib/thin/controllers/controller.rb:80:in `start'
>   thin (1.2.5) lib/thin/runner.rb:177:in `send'
>   thin (1.2.5) lib/thin/runner.rb:177:in `run_command'
>   thin (1.2.5) lib/thin/runner.rb:143:in `run!'
>   thin (1.2.5) bin/thin:6
>   /usr/bin/thin:19:in `load'
>   /usr/bin/thin:19
>
> Rendering /radiant/public/500.html (500 Internal Server Error)


[Radiant] Create Custom controllers and Views in Radiant

2011-03-09 Thread Shanison
Hi,

I have been searching to see if Radiant is able to integrate into
existing projects. And I saw this in the mail archive
http://www.mail-archive.com/radiant@radiantcms.org/msg04311.html It
seems that we can only package our existing projects as an extension
and put it in the Radiant project, but not the other way round.
However, I don’t understand that why we can’t do it.

In radiant project, there is no app folder, where it should contain
controllers, helpers and views.  So why can’t we create the directory
in this project. E.g. app/customs_controller.rb, and create an action
inside, and create the views. Now we just modify the routes.rb in
config/routes.rb to be able to map to this controller. Then we are
able to do any dynamic pages that we wanted. Isn’t it?

One of the concerns is that if we do this the future upgrade of
Radiant maybe difficult?

Thank you very much.
Shanison


[Radiant] Need advice: NoMethodError (undefined method `authenticate' for #

2011-03-09 Thread Dmitry Belitsky
Hello, I can't login on the one of our site more.
It show me application error when I try to log in.
Please advice me what I can do to resolve this issue.
Thanks a lot!

Log file:

Processing Admin::WelcomeController#login [POST]
  Parameters: {"action"=>"login",
"authenticity_token"=>"FWUgEe7WTxcXHD1xoLufxhhlWMXrOW0=",
"controller"=>"admin/welcome", "user"=>{"password"=>"[FILTERED]",
"login"=>"admin"}}

NoMethodError (undefined method `authenticate' for #):
  radiant (0.8.1) app/controllers/admin/welcome_controller.rb:13:in
`login'
  radiant (0.8.1) vendor/plugins/haml/rails/./lib/sass/plugin/rails.rb:
19:in `process'
  thin (1.2.5) lib/thin/connection.rb:76:in `pre_process'
  thin (1.2.5) lib/thin/connection.rb:74:in `catch'
  thin (1.2.5) lib/thin/connection.rb:74:in `pre_process'
  thin (1.2.5) lib/thin/connection.rb:57:in `process'
  thin (1.2.5) lib/thin/connection.rb:42:in `receive_data'
  eventmachine (0.12.10) lib/eventmachine.rb:256:in `run_machine'
  eventmachine (0.12.10) lib/eventmachine.rb:256:in `run'
  thin (1.2.5) lib/thin/backends/base.rb:57:in `start'
  thin (1.2.5) lib/thin/server.rb:156:in `start'
  thin (1.2.5) lib/thin/controllers/controller.rb:80:in `start'
  thin (1.2.5) lib/thin/runner.rb:177:in `send'
  thin (1.2.5) lib/thin/runner.rb:177:in `run_command'
  thin (1.2.5) lib/thin/runner.rb:143:in `run!'
  thin (1.2.5) bin/thin:6
  /usr/bin/thin:19:in `load'
  /usr/bin/thin:19

Rendering /radiant/public/500.html (500 Internal Server Error)


Re: [Radiant] Re: How to take advantage of server-side caching (Rack cache) without using browser caching

2011-03-09 Thread William Ross
On 9 Mar 2011, at 16:46, rosslaird wrote:

> I can find various online postings and tutorials about increasing the
> cache in rails, but is there a conventional way to do this in Radiant?
> In other words, how do you do this:
> 
>> The default cache timeout is only five minutes, though. I normally increase 
>> that to at least a week.


The governing variable is SiteController.cache_timeout, and one common place to 
set it is in config/environment/production.rb:

SiteController.cache_timeout = 24.hours

best,

will

[Radiant] Re: How to take advantage of server-side caching (Rack cache) without using browser caching

2011-03-09 Thread rosslaird
I can find various online postings and tutorials about increasing the
cache in rails, but is there a conventional way to do this in Radiant?
In other words, how do you do this:

> The default cache timeout is only five minutes, though. I normally increase 
> that to at least a week.

Ross


Re: [Radiant] How to take advantage of server-side caching (Rack cache) without using browser caching

2011-03-09 Thread William Ross
On 8 Mar 2011, at 16:18, Wes Gamble wrote:

> William,
> 
> Thanks for your reply.
> 
> On 3/8/11 9:37 AM, William Ross wrote:
>> 
>> On 5 Mar 2011, at 23:38, Wes Gamble wrote:
>> QUESTION: Is the current caching scheme in Radiant (Rack) completely 
>> dependent on client-side caching, implying that a given user _must_ do a 
>> full render before any caching benefits are realized?
>> 
>> 
>> No. The default cache timeout is only five minutes, though. I normally 
>> increase that to at least a week. During the timeout interval you should 
>> only be rendering the page once.
>> 
>> I have been wondering about putting a 'cacheable?' flag on snippets and 
>> perhaps even rendering them on save if that flag is set. It feels a bit 
>> overcomplicated, though. The time would probably be better spent making 
>> radius less slow in the first place.
>> 
> Even that one time is too much because it results in a ~10s page load.  In 
> the meantime, I have implemented the fragment cache extension (which although 
> it was last updated for Radiant 0.8, works fine in 0.9.1) to cache these 
> slow-rendering snippets.  
> 
> I think you've answered my question, in that it appears that Rack::Cache is 
> only "pre-configured" to handle freshness based client side caching, and 
> although you _could_ use it for server side caching, Radiant isn't set up out 
> of the box to do that.  I am still looking into it.  The default Etag 
> behavior implemented by Rails and Rack::Cache seems to only save you response 
> transmission time on a cache hit, which doesn't seem like a particularly big 
> win (if I understand correctly).

A successful Rack::Cache hit is a big win. A cache hit should reduce your 
response time to little more than webserver delays and in a relatively static 
radiant site with a long cache lifetime that's what you get. 

That's really the situation for which radiant is ideal. As soon as you move 
away from a simple publishing scenario it gets more strained, and if you 
introduce any degree of personalisation or responsiveness you're thrown back on 
the basic rendering machinery. As you've found, it's not optimised for speed. 
That's the price of flexibility: there is no determinate way to work out which 
pages are invalidated by changes to a particular object, so we can't render at 
save and there is no shortcut to an etag or even a last-modified date. We just 
have to render the page.

> Agreed on making Radius less slow - if I have time, I will look at it.

The good news there is that Radius development can proceed independently of 
radiant's release programme. The bad news is that the only real speedup will 
come from rewriting the ragel machine definition to emit C instead.

best,

will