Displaying 20 results from an estimated 1000 matches similar to: "can someone explain RoR MVC from a C++ or Java perspective?"
2009 May 07
13
what database field type should i use ??
in a database table if there is a field which has a certain set of
fixed values. for example
staus => {Single, Married, Divorced }
OR
state => {California, Albama, Olaska ...}
so what should be preferred way out of the following for storing the
values
1. Keep the field as "string(Rails)" VARCHAR(MySQL) itself ....and
while showing the field just show the field value.
2. Keep
2008 Apr 15
4
ActiveRecord::StatementInvalid in BlogController#index
Hello. I''m trying to do the video tutorial "how to build a blog engine
in 15 minutes with ruby on rails" from the main rubyonrails website,
and I''m getting an error when I try to use scaffold :post after
editing my config file for the mysql database.
Here is the exact error I''m getting:
ActiveRecord::StatementInvalid in BlogController#index
2008 Jan 30
1
undefined method `scaffold'
Hello,
I have been busy for a while and now I am back to messing with rails.
Last time I tried to use scaffold i worked now I am getting this error.
Not really sure since I am using version 1.2.5 still
NoMethodError in BlogController#index
undefined method `scaffold'' for #<BlogController:0x506eb7c>
Session dump
flash: !map:ActionController::Flash::FlashHash {}
Thanks for any
2005 Dec 23
2
has_many and belongs_to relationship error
Hi i am getting following error
ActiveRecord::StatementInvalid in Blog#index
Showing app/views/blog/index.rhtml where line #10 raised:
Mysql::Error: #42S22Unknown column ''posts.user_id'' in ''where clause'':
SELECT * FROM posts WHERE (posts.user_id = 4)
Extracted source (around line #10):
7: <div class="separator"> </div>
8:
2007 Aug 27
2
Can FILTERS AND VERIFICATION functions take arguments?
Hi,
I have some problems in using filter. My filter functions need to have
arguments, but filter functions take only symbol that refer to
function name. Consider the following code:
class BlogController < ApplicationController
before_filter :authorize
For instance, authorize need arguments. So how can I pass arguments to
filter function?
Any helps always appreciate.
2006 Jan 29
2
GetText and rjs templates?
hi,
is it possible that gettext don''t work with rjs templates?
i''ve just tried this simple example
blog_controller.rb :
class BlogController < ApplicationController
def index
end
def dosomething
end
end
index.rhtml :
<html>
<head>
<%= javascript_include_tag :defaults %>
</head>
<body>
<div id="test">Some text to change
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 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
2007 Nov 05
0
Scruffy > MVC architecture?
Hi,
I am a newby in rails...and i have read that scruffy is a great tool to
create/display images.
Now i find the code below for example...
graph = Scruffy::Graph.new
graph.title = "Comparative Agent Performance"
graph.value_formatter = Scruffy::Formatters::Percentage.new(:precision
=> 0)
graph.add :stacked do |stacked|
stacked.add :bar, ''Jack'', [30, 60, 49, 29,
2006 Aug 11
3
General architechture / MVC question
Hi all,
A newbie with Ruby on Rails - and programming in general - I''m working
on a few Flash and PHP projects as well. Partly to make my work more
efficient, partly to gain a better understanding of system architecture
/ design patterns, I''ve been trying to use the MVC pattern in
database-backed Flash / Actionscript development as well.
I think / hope that I''m
2006 Aug 01
5
MVC question
Should I create a separate controller for each model or should I use 1
controller for all models?
Having 1 "admin" controller for all backend stuff seems logic to me, but
when I scaffold it rather makes 1 controller per model.
I''m fairly new to the MVC pattern, so what''s the prefered way of doing
it?
I''m also wondering if the API is up to date? When
2007 Oct 09
0
[Slightly OT] MS MVC taking slight hints from Merb
http://www.hanselman.com/blog/ScottGuMVCPresentationAndScottHaScreencastFromALTNETConference.aspx
In Scott Guthrie''s talk (about 43:30) he mentions requiring the render
call as a convention.
Interesting to see Merb influence Microsoft. :)
--
Cheers,
Kevin Williams
http://kevwil.com/
http://www.almostserio.us/
http://kevwil.jaiku.com/
2006 May 08
3
MVC newbie question
All,
Is it possible for a view to call back to a controller method? If so,
what is the syntax?
=== details
I have a list view that I want to filter out inactive rows based on
several table fields being zero, old, etc.
It would seem I should create a "filtered" method in the controller
(which I have done).
Then invoke if from the view like:
for row in @rows
continue if row.filtered
2006 May 22
1
MVC and cron jobs
I have a cronjob that runs "ruby script/runner ''Channel.preload''".
Channel is a parent model, Item is the child model (i.e., Channel
has_many :items and Item belongs_to :channel). The coupling is
minimized, the coherence looks good, but I''m not sure the model is the
right place to put this code. Is there a better place to put this
code, e.g., a component (I
2006 Mar 02
7
The no-framework PHP MVC framework
"The no-framework PHP MVC framework"
http://toys.lerdorf.com/index.php?url=archives/38-The-no-framework-PHP-MVC-framework.html
Yuck! What spaghetti code. I can''t ever imagine preferring that to
Rails.
Joe
--
Posted via http://www.ruby-forum.com/.
2008 Feb 09
0
MVC interplay to query multiple models
I''m trying to track down why I''m getting close to desired output, but not
quite. It looks like the webpage sorta-kinda is grabbing the right
data. For instance, there are three Login objects which should be
showing and it looks like the show is grabbing three objects, so that
fits, to a degree. However, it''s just grabbing the hexadecimal object
id, and not
2006 Apr 23
8
Shattered, the rails-based MVC game development framework
if( you_want_to_make_a_game_with_ruby ) {
http://shattered.hastilymade.com/shattered_ruby.png
http://shattered.hastilymade.com/shattered_ruby.png
http://shattered.hastilymade.com/shattered_ruby.png
Shattered 0.3 has just been released! Inspired by Ruby on Rails, Shattered
is doing for game development what rails has done for web development.
Get it here !
We''ve made this
2006 Feb 06
4
Basic MVC in RoR question
Ok, Here''s my controller:
def create
trainingplan = Trainingplan.createplan(@params[:startdate],
@params[:enddate], @params[:hoursperweek], @params[:programtype])
end
My model is:
class Trainingplan <ActiveRecord::Base
def self.createplan(stardate, enddate, hoursperweek, programtype)
stardate = startdate
enddate = enddate
hoursperweek = hoursperweek
programtype
2006 Jun 22
2
MVC architecture
Hi,
I want to creat a GUI accessible via the web with ruby to interface some
matlab implementation ... so I extended Ruby with C++ and then matlab :)
that works perfectly: I have finaly a Ruby class I can call whenever I
want to lunch my matlab algorithm ;)
the point is now I have to make the GUI in HTML with Rubby on rails and
Damn! I don''t get how works the MVC architecture in Ruby
2007 Apr 20
2
MVC Philosophy
My directory browsing app shows lists of file. If the item is a folder,
show a folder icon and link to the action that shows directory contents.
If the item is a graphics file, show a thumbnail and link to a larger
view. If the item is a non-graphics file, show an appropriate icon and
stream the file if the link is clicked.
The controller creates an array of arrays of items in the current
folder,