Hi,
sorry to bother you guys with a simple sytnax question;
i have a loop of objects taking place (ie, for page in
@pages…xxxxxxx…end) and a link associated to each pages so that in
the end it looks like this:
page1 (link)
page2 (link)
page3 (link)
.
.
.
page n (link)
(all of this done by putting a simple ‘link to’ in the for loop.)
now i need to seperate two pages from the rest and link them to
somewhere else than the rest(let’s say page1 and page2 with the
corresponding id’s 1, 2 linked to ‘different’ action with the id as
passed paramateres)…my tries where somewhere along the line of
<%= link_to “regular”, { :controller => ‘regular’ ,:action => ‘show’,
:id => page} unless page.id == 1||2 %>
<%= link_to “different”, { :controller => ‘different’, :action =>
‘different’, :id => page } if page.id == 1||2 %>
or something similar. . .
but oddly enough when i use ||, it just puts all of the links to
different, instead of only 1 or 2. the weird part (to me) is that when i
take off the" || "
it works fine. (meaning, i can get my goal through if i do it with only
one page(either id=1 or id=2) , but when i try doing it on the both of
them with the same command, my idea doesn’t come through as i would have
liked it to…(no error involved, just not doing the magic!)
i know i must be missing something really simple, and so here i am
asking for that simple answer, if anyone would be as kind enough to pass
it along…
thanks for your help!
smr