forked from lardawge/rfm
-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
ginjo-rfm-3.0.12
Rails 6.0.2.2
When executing the Find method, no exception is thrown if there is no such record.
sample code
—
Models / art.rb
class Art < Rfm::Base
config :layout => 'English_Form_View',
:host => "127.0.0.1",
:port => 16020,
:account_name => "admin",
:password => "xxxxxxxx",
:database => "FMServer_Sample",
:raise_on_401 => true,
:ssl => false
end
—
Controllers / art_controller.rb
class ArtController < ApplicationController
...
def search
begin
@records = Art.find "TextForSearch" => params[:Search]
flash[:notice] = Art.config[:raise_on_401] # true
end
rescue Rfm::Error::NoRecordsFoundError
flash[:notice] = "'#{params[:Search]}' could not be found.”
@records = Art.all
end
end
...
Metadata
Metadata
Assignees
Labels
No labels