From this documentation I see that I can use the select method like this:
select("post", "person_id", Person.all.collect {|p| [ p.name, p.id ] }, { :include_blank => true })
and it yields:
<select name="post[person_id]">
<option value=""></option>
<option value="1" selected="selected">David</option>
<option value="2">Sam</option>
<option value="3">Tobias</option>
</select>
What would my select method look like if I have an array like this:
[["Add Post", new_post_path],["Add Document", new_document_path],["Add Coupon", new_coupon_path]]
And I want html like this:
<select name="post[person_id]">
<option value="new_post_path" selected="selected">Add Post</option>
<option value="new_document_path">Add Document</option>
<option value="new_coupon_path">Add Coupon</option>
</select>
In your controller:
In your view
This should put the actual URL in the value field. If you want the strings as you noted above, but the paths in quotes, e.g.
["Add Post", "new_post_path"]