Ruby on Rails Monday, March 12, 2018

Hi,

I have two controllers

1,  api/risk_profiles
2,  admin/risk_profiles

When i submitted a form then a new record was created in 'api/risk_profiles'  controller and the action name 'create'.

Now, i want to redirect to 'admin/risk_profiles' show action. Because i have upload some API process is there. currently i have used the below codes but it not performed



def create
    @risk_profile = RiskProfile.new(risk_profile_params)

    if @risk_profile.save
          redirect_to api_risk_profiles_url(:id => @risk_profile) 
    end
  end



Note:

Rails console result
Daya

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CADKeJyQ2%3D3w-Hh%3DSNYs6KhZbNa9hCHG9jERdVAtagp0YKnjsjg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment