0

I have a flash notice that causes cookie overflow error:

candidates = Hiring::Candidate.find(params[:candidate_ids])
notice     = render_to_string(partial: '/hiring/candidates/new_candidates_assigned',    locals: {candidate: candidates})

redirect_to path, notice: notice

I suppose it's because of a lot of object passed to flash. How this can be avoiding?

1 Answers1

1

Just set the message you want to display in your controller

redirect_to path, :notice => "Successfully assigned new candidate"

Render the partial in your view and pass the flash notice as a local.

<%= render partial => '/hiring/candidates/new_candidates_assigned', :locals => {:flash_notice => flash[:notice]}%>
usha
  • 28,973
  • 5
  • 72
  • 93