similar to: MVC question

Displaying 20 results from an estimated 7000 matches similar to: "MVC question"

2006 Jun 08
3
MVC and Pagination
Just wondering how to best integrate with pagination and still stick to MVC... Say I have a Post model that has a published attribute. I want to show all the recent published posts on a page. My first instinct is to create a method in the Post model called recent that does the find with proper conditions and order, but the problem I have is how do I use that with pagination (which definitely
2006 Jan 17
30
MVC design good/bad
I am curious what you find is good and bad MVC design. Let''s use the find and find_by_sql methods as examples. Currently I have these spread out all over the place... View: here I have some find methods when I am for example populating a select list with choices in a form. Controller: here I have the simpler find methods. Model: here I have the more complicated find methods (usually
2006 Oct 20
7
MVC and modules. Views telling models to behave
I was thinking today, it would be nice if a view could tell a model how to format it''s data for that particular view. Kind of like, the view is bestowing instant, and temporary knowledge on the model for the duration of the views run. It seemed to me that this would be more objecty than say a helper that formats a string format_my_string( my_string ) Instead, in my view. Lets assume I
2007 Sep 01
2
@content_for_layout or changing default fields on "new" page
Hi all, I test my small Rails apps using SQLite3, but I think the problem appeares in every type of database. . When I create table and scaffolding apps, a HTML view is based on columns types. Everything is OK until I want to change preconfigured behaviour. . I created table with a column of type INTEGER, but I wanted to display check box instead of text field and then save 0 or 1 in database.
2005 Apr 24
2
Model names in controllers
Please excuse yet another newbie question... I''m getting this error: MissingSourceFile in <controller not set>#<action not set> c:/program files/ruby/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/dependencies.rb:75:in `require_dependencies'': Missing model MyModel.rb From these lines of code: class MyModelController < ApplicationController
2006 Mar 28
5
combining two models in one controller/view "set"
I''m going to take another stab at this question (my first one received no replies): I have two models: Author has_many: books Book has_one: author I have two tables: authors id ... books id author_id ... I let the scaffolding fly and it created the CRUD goodness for each model, as expected. However, I want to have only one view/controller "set" for both models; when I
2006 Aug 18
3
Understanding MVC - view customization after using scaffolds
All, I have ordered AWDWR and am anxiously awaiting its arrival. In the meantime I still am playing with ROR using radrails. I have a few questions ... I create a table named customers with the following details: Field Type Null Key Default Extra id int(11) NO PRI auto_increment customer_name varchar(50) NO inbound_retention int(11) NO outbound_retention int(11) NO unix_admin_email
2006 Aug 02
2
Feature request
Is there a place for feature requesting? Rails uses the "@" prefix for vars in the request scope, why not add a prefix for the session scope? Instead of "session[:myvar]" it could then be something like "%myvar". -- Posted via http://www.ruby-forum.com/.
2006 Feb 27
3
form questions
I have a very simple form that looks allows an input for an error code and then give the show page from the scaffolding if the error code is in the database and a notification on the list page, again from the scaffolding if not. Here''s the form: find.rhtml <h1>Find error</h1> <%= start_form_tag :action => ''search''%> <p><label
2006 Jul 18
13
RANDOM
I am pretty much new at this ROR game and had what I think to be a simple question. I have a set of Sponsors that I would like to be able to select one at random and display in the my html. I have already set up the DB, scaffolded, set index controller and all is working smoothly. I know that I can display them all by doing <% for sponsor in @sponsors %> <%= sponsor.name %>
2008 Nov 02
5
Issue with domains
I am running Dovecot 1.0.10 and have it working great on ender.ath.cx (my free DynDNS.com subdomain), but recently I registered lemcoe.com and pointed it to the same IP address as ender.ath.cx. The problem is, only e-mail sent to the @ender.ath.cx works. If it is send it to @lemcoe.com, I don't know where it goes. I get no errors either. How can I get Dovecot to recognize both domains? TIA.
2012 Feb 02
3
MVC questions with rails
2001 Apr 01
3
command.com/edit.com
Hey all. I'm trying to do some win32 compilation under Wine, but I really need to get some form of console (and maybe dos edit, my favorite programmers editor :). Anyone tell me how I can either get these working, or get something siilar which DOES work under Wine? Regards, Ender _________________________ ______________________________ | James 'Ender' Brown | Some call me
2007 Jul 09
2
Accessing model objects directly in the view
Is there any general guidelines for accessing model objects directly in the view? It seems like it would be a potential problem - that it would be better to keep model objects out of the view entirely. Instead, the controller should extract whatever data is needed from the model and put it into temporary objects, thus protecting the views from any changes in the models and keeping them from
2001 Aug 16
1
rsync test harness
You can now do "make check" in the CVS version of rsync and it will run some elementary self tests. It also runs these tests on build.samba.org, which should help catch unintended regressions, particularly on unusual platforms. Contributions of more test cases would be welcome. -- Martin
2006 Jul 06
6
Class variables in templates/layouts
I''m having problems with class variables.. I have a class: class Content::ApplicantsController < ApplicationController layout "mylayout" @@tab = "mystring" [... the rest is standard scaffold-created stuff ...] and a layout (mylayout.rhtml): [...] <title><%= @@tab.capitalize %></title> [...] And I keep getting this error: uninitialized
2006 Apr 05
1
select in *.rhtml
I''m trying to get a select box of categories to appear in my items views after I created everything using generate scaffold, but I can''t get the categories to appear in my forms. class ItemsController < ApplicationController def new @item = Item.new @category = Category.find_all end ... class Item < ActiveRecord::Base belongs_to :category end class
2006 Mar 27
3
Define methods for controllers, helper AND models?
Hi all I know that I can define methods in e.g. the application controller and make them available to the helpers using helper_method(), but how can I make them available in the models? I have for example the following method, that I want to be able to call from any model I wish... def ApplicationController helper_method :member def member session[:member] end end Thanks for any
2005 Dec 18
1
date_select and impossible dates....
hi, using date_select right from a generated scaffold code leads to an error if an impossible date is selected (like the 31 of february) can''t get a way to correct this via a validation.... in fact that make sens because in the model i have the ''dateofbirth'' object which is a date object.... so providing an impossible day-month-year trio leads to an impossible
2006 Jun 21
0
rails MVC
Bonjour a tous, voila j''ai quelque soucie a comprendre comment s''enchaine les appels de la vue/controleur/model dans Rails :( j''ai une classe qui me permet de faire la liaison entre ruby et c++ (ca marche parfaitement) que j''ai mis ds le repertoire model (je ne l''ai pas cree avec generate parce que je ne veux pas de BD! et j''avais