Rails 1.1, Markaby, options_from_collection


#1

Last night, I upgraded one of my rails apps to 1.1. This app uses
Markaby exclusively for its’ views, and once I checked out the latest
revisiong of Markaby (r33), everything was working fine except for one
thing:

select_tag(‘province_id’, options_from_collection_for_select(@provinces,
“id”, “name”))

Now returns this (as you see it is spitting out the options both before
and after the opening select tag):

<option value=“2”>Alberta</option>

<option value=“1”>British Columbia</option>

<option value=“5”>Manitoba</option>

<option value=“8”>New Brunswick</option>

<option value=“9”>Newfoundland</option>

<option value=“12”>Northwest Territories</option>

<option value=“7”>Nova Scotia</option>

<option value=“13”>Nunavut</option>

<option value=“6”>Ontario</option>

<option value=“10”>Prince Edward Island</option>

<option value=“3”>Québec</option>

<option value=“4”>Saskatchewan</option>

<option value=“11”>Yukon Territory</option><select
id=“province_id” name=“province_id”><option
value=“2”>Alberta</option>

<option value=“1”>British Columbia</option>

<option value=“5”>Manitoba</option>

<option value=“8”>New Brunswick</option>

<option value=“9”>Newfoundland</option>

<option value=“12”>Northwest Territories</option>

<option value=“7”>Nova Scotia</option>

<option value=“13”>Nunavut</option>

<option value=“6”>Ontario</option>

<option value=“10”>Prince Edward Island</option>

<option value=“3”>Québec</option>

<option value=“4”>Saskatchewan</option>

<option value=“11”>Yukon Territory</option></select>

Any Markaby users seeing this behavior? Using the same tag in an rhtml
view works as expected.


#2

Ok, let’s try that again:

Alberta British Columbia Manitoba New Brunswick Newfoundland Northwest Territories Nova Scotia Nunavut Ontario Prince Edward Island Québec Saskatchewan Yukon TerritoryAlberta British Columbia Manitoba New Brunswick Newfoundland Northwest Territories Nova Scotia Nunavut Ontario Prince Edward Island Québec Saskatchewan Yukon Territory

#3

Well after some help from _why, problem solved. Any helpers are
automatically output to the stream, so you have to change the call to:

select_tag(‘province_id’,
@helpers.options_from_collection_for_select(@provinces, “id”, “name”))

Brad D. wrote:

Last night, I upgraded one of my rails apps to 1.1. This app uses
Markaby exclusively for its’ views, and once I checked out the latest
revisiong of Markaby (r33), everything was working fine except for one
thing:

select_tag(‘province_id’, options_from_collection_for_select(@provinces,
“id”, “name”))


#4

Just an update to this. This appears to be an issue with r33 of Markaby
in general, and appears in both Rails 1.1 and 1.0. I was able to get
things working well by exporting the tagged version 0.3 of Markaby into
my markaby folder in vendor/plugins.

svn export http://code.whytheluckystiff.net/svn/markaby/tags/0.3/
vendor/plugins/markaby/ --force

So far, so good…

Brad D. wrote:

Last night, I upgraded one of my rails apps to 1.1. This app uses
Markaby exclusively for its’ views, and once I checked out the latest
revisiong of Markaby (r33), everything was working fine except for one
thing:

select_tag(‘province_id’, options_from_collection_for_select(@provinces,
“id”, “name”))

Now returns this (as you see it is spitting out the options both before
and after the opening select tag):

<option value=“2”>Alberta</option>

<option value=“1”>British Columbia</option>

<option value=“5”>Manitoba</option>

<option value=“8”>New Brunswick</option>

<option value=“9”>Newfoundland</option>

<option value=“12”>Northwest Territories</option>

<option value=“7”>Nova Scotia</option>

<option value=“13”>Nunavut</option>

<option value=“6”>Ontario</option>

<option value=“10”>Prince Edward Island</option>

<option value=“3”>Québec</option>

<option value=“4”>Saskatchewan</option>

<option value=“11”>Yukon Territory</option><select
id=“province_id” name=“province_id”><option
value=“2”>Alberta</option>

<option value=“1”>British Columbia</option>

<option value=“5”>Manitoba</option>

<option value=“8”>New Brunswick</option>

<option value=“9”>Newfoundland</option>

<option value=“12”>Northwest Territories</option>

<option value=“7”>Nova Scotia</option>

<option value=“13”>Nunavut</option>

<option value=“6”>Ontario</option>

<option value=“10”>Prince Edward Island</option>

<option value=“3”>Québec</option>

<option value=“4”>Saskatchewan</option>

<option value=“11”>Yukon Territory</option></select>

Any Markaby users seeing this behavior? Using the same tag in an rhtml
view works as expected.