Skip to content

Commit

Permalink
refactor existing code . use unless
Browse files Browse the repository at this point in the history
  • Loading branch information
Neeraj Singh committed Nov 9, 2010
1 parent dfd217c commit dff8c68
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/controllers/admin_data/search_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ def advance_search
format.html { render }
format.js {

if !hash[:errors].blank?
render :file => "#{plugin_dir}/app/views/admin_data/search/search/_errors.html.erb", :locals => {:errors => errors}
unless hash[:errors].blank?
file = "#{plugin_dir}/app/views/admin_data/search/search/_errors.html.erb"
render :file => file, :locals => {:errors => errors}
return
end
if params[:admin_data_advance_search_action_type] == 'destroy'
Expand Down

0 comments on commit dff8c68

Please sign in to comment.