So I have a list of jobs which I show like this. (cleaned up…)
_list.rhtml
<%= job.name %> | <%= check_box_tag "job_ids[]", job.id %> |
So I have a list of jobs which I show like this. (cleaned up…)
_list.rhtml
<%= job.name %> | <%= check_box_tag "job_ids[]", job.id %> |
Hi,
You are right about the checkbox; it should look something like that.
I believe the correct form is:
<%= check_box(“job_ids”, jod.id) %>
Then you just use an old school form(on top of my head):
<%- form_tag :controller => ‘foo’, :action => ‘bar’ do -%>
<%= check_box(“job_ids”, jod.id) %>
<%= submit_tag(“Go”)
<%- end -%>
But I might be sadly mistaken.
With kind regards,
Harm
Yea, not so much.
I need to then access the data in the controller.
And I want to be able to do different things to the data based on
three different (Links or Submit Buttons)
On Jan 19, 10:36 pm, Mark [email protected] wrote:
Yea, not so much.
I need to then access the data in the controller.
But you can pull that from the params right? params[:job_ids] is an
array of ids.
And I want to be able to do different things to the data based on
three different (Links or Submit Buttons)
In that case you can look at the params[:commit] value.
Ok.
So I finally got that working.
Parameters: {“commit”=>“delete selected”, “job_ids”=>[“1632”, “1633”,
“1634”], “action”=>“updateselected”, “controller”=>“jobs”}
I can access the Ids no problem from the controller.
Now the only thing I would like to do is make these “links” instead of
“submit buttons” to make the app look a little better.
I want to either have three links [Delete Selected, Publish
Selected, UnPublish Selected]
Or do a Drop down like Gmail does for the actions availble when I
select a bunch of emails.
Can anyone help with that?
Right now all I have in the view is
<%= submit_tag ‘delete selected’%>
<%= submit_tag ‘publish selected’%>
…
Thanks,
Mark
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs