Forum: Ruby on Rails question about componets

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Michal K. (Guest)
on 2005-12-05 07:05
Hi guys.
I have a problem with access to ActiveRecord by component controller
basicly what I have is:
from outside view:
<%= render_component(:controller => 'webeditor/editor', :action =>
'show',:params => {:editorName => 'test'}) %>

now in component controler (components/webeditor/editor_controller.rb)
I want to do:

class Webeditor::EditorController < ApplicationController
  uses_component_template_root

  def show
    @editor = Webeditor::Editor.find(:first,:conditions => ["editorName
= '"+params[:editorName]+"'", params])
    render(:layout => false)
  end
end

and I'm getting:
NoMethodError in Webeditor/editor#show

undefined method `find' for
Controllers::Webeditor::Editor:Dependencies::LoadingModule

RAILS_ROOT: ./script/../config/..


any idea?
This topic is locked and can not be replied to.