Forum: Ruby on Rails question about componets

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and 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

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

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

undefined method `find' for

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

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