On Nov 4, 2007 3:55 PM, Patrick J. Kattau <<a href="mailto:pkattau@gmail.com">pkattau@gmail.com</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi, I'm fairly new to rails and masterview. I'm sure this answer was probably staring me in the face already but all screencasts of masterview that I have seen to date only deal with one table and one model. What about using multiple tables and models? I was trying to add another link under 'tasks' that pointed to a different controller and action but it didn't seem to work. Any guidance would be appreciated.
<br></blockquote></div><br><br>Patrick,<br><br>In general most anything that you can do with Rails or ERB/rhtml we should be able to do with MasterView since we ultimately output ERB anyway.<br><br>So the answer is yes, you can work with multiple tables, models, and controllers with MasterView.
<br><br>In the example of using multiple controllers with your links, you simply add the controller property into the directive just like you would do if using the Rails link_to helper. For example:<br><br><pre><a mv:link_to=":controller => 'admin', :action => 'new'">New product</a>
</pre><br>This allows you to access a different controller than the current one. <br><br>In general think about how you would do it in ERB or with native Rails helpers and that is what you typically want to do with MasterView.
<br><br>Blessings,<br><br>Jeff<br><br>-- <br>Jeff Barczewski, MasterView core team<br>Inspired Horizons Ruby on Rails Training and Consultancy<br><a href="http://inspiredhorizons.com/">http://inspiredhorizons.com/</a>