Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8806855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:13:47+00:00 2026-06-14T02:13:47+00:00

@id =params[:ad] @empreasset = params[:check_box_id] case params[:commit] when ‘delete’ @empreasset.each do |empreasset| @em =

  • 0
    @id =params[:ad]
   @empreasset = params[:check_box_id]
    case params[:commit]
    when 'delete'
      @empreasset.each do |empreasset|
        @em = Empreasset.find(empreasset)
        @em.destroy
  end
  @size=@empreasset.size
  @message = "#{@size} Employee asset(s) deleted sucessfully"
  respond_to do |format|

      format.html {redirect_to :action => :index, :id => @empreasset.ad}
      format.json {head :no_content}

end

Here (@empreasset.ad=@id) Also logic can be format.html {redirect_to :action => :index, :id => @id}
It is also ok. But error occurs..
In controller index i have to send value of id. As @empreasset.ad has same value for all data. I need to send one @empreasset.ad value. But how can it be possible since @empreasset.ad is in array. How can i pick only one value of @empreasset.ad and send in

redirect :id => @empreasset.ad?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T02:13:48+00:00Added an answer on June 14, 2026 at 2:13 am

    Write one more line . empreasset=@empreasset.first

    then

    format.html {redirect_to :action => :index, :id => empreasset.ad}

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

@video = Video.find(params[:id]) @lengths = @video.each do |i| @length = i.length * 60 end
def update @album = Album.find(params[:id]) if @album.update_attributes(params[:album]) redirect_to(:action=>'list') else render(:action=>'edit') end end A Rails
i have this statement: if user = params[:user] && action == :delete end why
Auto-binding of request params seems like default behaviour, but I can't find a lot
params[:codes] = 9,10 @result = Candidate.find :all, :joins => params[:codes].split(',').collect {|c| [INNER JOIN candidates_codes
media = Media.new(params[:media]) media.save @attachment.media = Media.find(????) @attachment.save I tried just doing media.id but
content = Content.find(params[:content_id]) content.body.insert(start_index, span_open) content.save! content.body.insert(end_index + span_open.length, span_open) content.save! puts ========================================== c
if params[:parent_type] == Order parent_id = nil else parent_id = params[:parent_id] end Would a
def index unless params['excel'].blank? render_csv(patients-#{Time.now.strftime(%Y%m%d)}) else render end end def render_csv(filename = nil) filename
params = {'fruit':'orange', 'color':'red', 'size':'5'} How can I turn that into a string: fruit=orange&color=red&size=5

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.