checkbox - Rails check box in form decides on create action in controller? -
I am trying to add a selected box based on my build that decides that an action moves from the controller If any new project is created then:
def make @company = Company.find (params [: cz] [: company_id]) @cases = @ company.cases. Crete! (Param [: Case]) response_to do | Format | [Sample: send_to_freeagent]? @case.kreate_frigent_project (current_useur) #flash [: notice] = 'The case was created successfully.' Flash [: notice] = fading_flash_message ("The case was created successfully.", 5) format.html {redirect_to (@kase)} format.xml {render: xml = & gt; @case: Status = & gt; : Created: Location = & gt; @case} and end
and I have in my form:
What I would like to do, is that whether the selection box is checked that the project is sent to the freezer, if not, the case is made locally just as normal Sending FreeAgeent data
If I use the code above, I get an exception caught error:
by any means What am i doing
I
def create @company = Company.find (params [: kase] [: company_id]) @ case = @ company.Cases.Create! (Param [: caze]) @ case.kreate_frigent_project (current_user) if parameter [: send_to_freeagent]. To_bool response_to do | Format | # ... and end
Comments
Post a Comment