Martyn Elmy-liddiard wrote:
Obviously my Model code is wrong
No offense intended, but there're problems with all your code.
Status <input type="text" name="Status" size="20"><p>
You're hardcoding your form instead of using eRb. Rails will have a hard time figuring out what you're asking it to do. You'll need to decide whether you want your params bound to a model or not: text_field vs. text_field_tag.
> In the Risk Controller I have the following Code:-
@found = Risk.liststatus2
Params get passed back to the controller in a hash. In the case above, the value is coming back in a param you'd address like:
@found = params[:Status]
and finally in the Model I have the following code:-
find(:all, :conditions => "Status = ?", @Status)
The value is in @found.