On 25 Mar 2011, at 16:47, John Merlino wrote:
> Frederick Cheung wrote in post #988949:
>> On Mar 23, 8:52pm, John Merlino wrote:
>>>
>>>
>if
> params[:controller].singularize.capitalize.constantize.method_defined?
> :viewable
Why not just controller.respond_to? :viewable ?
Fred
On 25 March 2011 16:47, John Merlino wrote:
> ...
> It works but I dont like that I am checking whether a model has the
> method "viewable" just to display a link to a detail view in the table.
> Is there a better way to determine if the current controller's table
> should contain a view or not?
Frederick Cheung wrote in post #988949:
> On Mar 23, 8:52pm, John Merlino wrote:
>>
>> params[:controller].singularize.constantize.responds_to(:viewable)
>
> Presumably this is the line throwing the error. If params[:controller]
> is users then you'll be calling
> constantize on the string user. C
On Mar 23, 8:52 pm, John Merlino wrote:
>
> params[:controller].singularize.constantize.responds_to(:viewable)
Presumably this is the line throwing the error. If params[:controller]
is users then you'll be calling
constantize on the string user. Constants have to start with a capital
letter, so
4 matches
Mail list logo