2015-03-02 69 views
0

如果自定義表單域填充,如何發送電子郵件?Rails。當自定義表單域參數發送創建通​​知

def create 
    @act = Act.new(act_params)  
    respond_to do |format| 
     if @act.save 
     ModelMailer.new_act_notification(@act).deliver_later if customer_id == '617' 
     format.html { redirect_to @act, notice: 'Act was successfully created.' }  
     else 
     format.html { render action: "new" } 
     end 
    end 
    end 

回答

0

除非您設置變量customer_id,否則這將不起作用。我想你想要的是這樣的:

我認爲當你說「自定義表單字段PARAM」,你指的是物體在@act的CUSTOMER_ID參數。