Ruby on Rails Wednesday, December 15, 2010

Colin Law wrote in post #968580:
> On 15 December 2010 14:38, Marnen Laibow-Koser <lists@ruby-forum.com>
> wrote:
>> Colin Law wrote in post #968551:
>>> On 15 December 2010 12:00, Ron Phillips <lists@ruby-forum.com> wrote:
>>>> I am using Spreadsheet to produce reports. Is there a Railsy way to put
>>>> Spreadsheet creation in the Views?
>>>
>>> In what way are you creating a spreadsheet? Do you mean an excel
>>> spreadsheet? If so why would you want to create it in the view?
>>
>> Well, it *is* a presentation of model data...
>
> That rather depends on what the OP is trying to do. If he is writing
> an excel spreadsheet file then that is no more a view than is the
> database itself, it is just data stored in a file.

*All* views are just data stored in a file. The point is that --
whether meant for export or direct display -- this is, as far as Rails
is concerned, a presentation of model data, and so is arguably a view.

Now, I probably wouldn't actually use a view file to export data to a
spreadsheet in Rails; I'd generate the spreadsheet in the controller and
have done with it. But that's due to Rails' overly narrow
interpretation of what a view is, not to anything fundamental in MVC
philosophy.

> If however he is
> somehow displaying the spreadsheet inline in a web page then I would
> agree with you. We need more information from the OP wants to do.

True for Rails. Not true for generic MVC.

>
> Colin

Best,
-- 
Marnen Laibow-Koser
http://www.marnen.org
marnen@marnen.org

Sent from my iPhone

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment