I had a code below:
@brand = Brand.find_by_id(params[:id])
if @brand.nil?
flash[:error] = Flash.record_not_found
redirect_to admin_brands_path
end
And another change to below:
@brand = Brand.find_by_id(params[:id])
return(flash[:error] = Flash.record_not_found and redirect_to admin_brands_path) if @brand.nil?
Which code do you think is more efficient and explain? and when you have another suggest you can share too.
Thanks in advance.
user_phoneparam value fromHTTP X Header. how can I sent this param inmy video_controller_test.rbfile. like in myvideo_controller.rbget values as:user_phone = request.env['HTTP_X_MSISDN'].to_s