# View code confusion

**URL:** <https://www.ruby-forum.com/t/view-code-confusion/73128>\
**Category:** Rails\
**Created:** [October 21, 2006, 8:04pm UTC](https://www.ruby-forum.com/t/view-code-confusion/73128 "2006-10-21T20:04:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![craigrails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Post date:** [October 21, 2006, 8:04pm UTC](https://www.ruby-forum.com/t/view-code-confusion/73128/1 "2006-10-21T20:04:27Z")

</div>

I am trying to do this inside a view template (pass 3 values,  
facility.id, @inc\_beg\_date and @inc\_end\_date)…

\<% for incident in IncidentReport.include facility.id @inc\_beg\_date  
@inc\_end\_date %\>

and the error I get is  
compile error  
script/…/config/…/app/views/reports/facilities/incident\_report.rhtml:39:  
syntax error, unexpected tIVAR, expecting kDO\_COND or ‘:’ or ‘\n’ or ‘;’  
for incident in IncidentReport.include facility.id @inc\_beg\_date  
@inc\_end\_date ; \_erbout.concat “\n”  
^  
script/…/config/…/app/views/reports/facilities/incident\_report.rhtml:65:  
syntax error, unexpected kEND, expecting $end

and if I put commas in to separate the values, like this,  
\<% for incident in IncidentReport.include facility.id, @inc\_beg\_date,  
@inc\_end\_date %\>  
I get  
script/…/config/…/app/models/incident\_report.rb:16: syntax error,  
unexpected $end, expecting kEND

and if I enclose in parens the errors are the same

How do I pass 3 values from within view code (because I can pass 1 value  
no problem)

Craig

---

<div class="post-metadata">

**Author:** ![craigrails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Post date:** [October 22, 2006, 5:03am UTC](https://www.ruby-forum.com/t/view-code-confusion/73128/2 "2006-10-22T05:03:48Z")

</div>

Get freelance or telecom-job here!!

> **[Google Sites: Sign-in](https://accounts.google.com/v3/signin/identifier?dsh=S1225198800%3A1689802857190158&continue=https%3A%2F%2Fsites.google.com%2Fsite%2Fsites%2Fsystem%2Ferrors%2FWebspaceNotFound%3Fpath%3D%2Ffreelancetelecom%2F&followup=https%3A%2F%2Fsites.google.com%2Fsite%2Fsites%2Fsystem%2Ferrors%2FWebspaceNotFound%3Fpath%3D%2Ffreelancetelecom%2F&ifkv=AeDOFXiuKIpPqHVm4qdGvKwKMgwtezVjj9vN16gl5eVxHJqA7asoyHXhPbJRTvF3E_kSHLNXFeRv&passive=1209600&service=jotspot&flowName=GlifWebSignIn&flowEntry=ServiceLogin)**
>
> Access Google Sites with a personal Google account or Google Workspace account (for business use).

---

<div class="post-metadata">

**Author:** ![craigrails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Post date:** [October 23, 2006, 3:41am UTC](https://www.ruby-forum.com/t/view-code-confusion/73128/3 "2006-10-23T03:41:58Z")

</div>

Steve thanks - I actually figured it out - it drove me crazy and I had  
to walk away from it.

For completeness, there were 2 problems so that everything I tried  
wouldn’t work until I examined each and every error message and it  
turned out there was a syntax error in my model which was receiving this  
call and the error message was so similar, it evaded detection for quite  
some time.

Had I looked closely enough at the 2 errors that I had included…the  
second one specifically referred to app/models/incident\_report.rb which  
was different from app/reports/facilities/incident\_report.rb

;-(

Ultimately, the 3 values passed exactly as I had tried it (required  
commas)

\<% for incident in IncidentReport.include facility.id, @inc\_beg\_date,  
@inc\_end\_date %\>

As RoseAnn Rosannadanna says…it’s always sumthin’

Craig

---

<div class="post-metadata">

**Author:** ![craigrails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Post date:** [October 23, 2006, 1:25am UTC](https://www.ruby-forum.com/t/view-code-confusion/73128/4 "2006-10-23T01:25:42Z")

</div>

Craig–

I didn’t see a reply to your question. What is the type of  
IncidentReport and what are you trying to do with the resultant values?
