Displaying 20 results from an estimated 200 matches similar to: "Testing components"
2006 Jun 09
0
Controller Modules Messed Me Up
Modules are exactly what I needed to figure out, but once I started my
app over again putting my controller under a module folder, I can''t get
my basic app going.
Basically I have a News app, where we will post PR and other articles of
interest. It was working fine with a model/controller combo of
news/index for the public and news/admin for the administrators. Keep
in mind this
2006 Dec 10
5
model-controller-paradigm: What about admin controllers?
Hi all
We all know the model-controller-paradigm: I have a model "News" which
has a corresponding CRUD-controller "NewsController".
But now I''m quite unsure about the following...
Guess we have normal visitors that visit our site www.??.com/news and we
have administrators that create and modify news items.
The admin should see an "Edit" link and a
2006 Jan 31
3
Lost in routing
I''m trying to create a modules based system where my controllers are
all under modules. So the structure looks something like:
app/
controllers/
message/
news_controller.rb
email_controller.rb
library
books_controller.rb
pictures_controller.rb
home_page_controller.rb
Each of those controller has
2013 Jan 16
1
equivalent code that doesn't return same results?
I need to automate changing the reference value for factors in analysis, and
it is my understanding that the following two sets of code should produce
identical results, but they do not:
1)dataset$method
2)eval(parse(text=paste("dataset",IVcat[k],sep="$"))) (in this case I
have IVcat[k]=method, which is why they are equal)
I even tested them in R, which says that these
2006 Feb 08
2
URL rewriting
Here is the scenario I am trying to achieve. Basically, I want to run
the action "show" from my controller, without adding the "show/id".
Standard:
http://www.domain.com/controllerName/show/id
I would like:
http://www.domain.com/controllerName/randomstring (where randomstring is
a
field in my model/table, that is equivalent to a GUID -> and unique).
I''m confused
2006 Apr 20
4
Many to Many Category structure with itself
Basically, I''m trying to have a table called "categories" have a many to
many relationship with itself. But I also want each catagory to be able
to be "copied" into another category so it is essentially a child
category to more than one parent. To me the obvious way of doing this is
by creating another table called category_maps (and a model called
CategoryMap).
2006 Feb 07
5
homepage instead of welcome page?
Got a noob question for ya...
When I visit http://localhost:3000/
I get the nice "Welcome to rails" page. To get to a controller I have to
go to:
http://localhost:3000/controllername
What if I don''t want the welcome message and want / to resolve to a
controller?
How do I set that up?
Thanks,
Dave
--
Posted via http://www.ruby-forum.com/.
2005 Jan 28
16
primary_key_prefix_type, support for non-integer primary keys
Hello!
I''m just starting out with Rails--and Ruby itself for that matter--and
have a couple of questions regarding primary_key_prefix_type and
non-integer primary keys.
I see in the ActiveRecord documentation [1] that by default the primary
key of a table "foo" is expected to be "id", though
primary_key_prefix_type this can be changed to :table_name or
2008 Aug 20
1
Facebook javascript (FBJS) library
I wrote an fbjs library to help speed up development of some of my
applications. I plan to have some sort of "official" release with a blog
entry and github repository at some point, but I thought you guys might want
to have it earlier.
It''s still a work in progress. I''ve been using every method at least once in
my application but it''s still possible there is
2007 Jul 19
7
NoMethodError in partial driving me mad
Hello,
i simplified have a news model, a news category model and a news
controller.
my _news.rhtml partial renders a single news entry.
in my controller there are the actions show and show_category.
if the "show" action is called, a single news item is rendered through
my partial with no errors.
if the "show_category" action is called, i get a NoMethodError while
displaying
2006 May 08
2
Noob Question - Variable Scope
I feel awful asking such a basic question, but here it goes....
I have a controller, "NewsController".
The user enters and the "list" action is called and I populate an
instance variable "@news" which contains all the elements I''d like to
display using a form.
The user then changes something and the "update" action is called.
Is
2006 Mar 29
4
Scaffold generator: create vs. new
Can anyone supply me with a simple, succinct explanation of what the
difference is between the "new" controller and the "create" controller
that the scaffold generator produces?
I run:
> script/generate scaffold modelname controllername
And now I need to do some work inside the controllername.rb file. For
example, pulling a list from another database table to supply
2006 Jan 04
4
HOWTO: Render partial in div
Hey-
I''m using ROR 1.0 and script.aculo.us 1.5.1. I''ve been trying
unsuccessfully to render a partial in a DIV, but can''t seem to get the
right combination of stuff to make it work. There seems to be a few
different ways of going about it. Right now I can render a partial.
What do I need to to render the partial in a div? Here is what it
looks like so far:
#
2006 Jan 08
4
Rails table pluralizing Issue
Hi,
I am working on a table with name "addresses". However when I do a
ruby script/generate scaffold Address, I am not able to access
http://localhost:3000/addresses. I am getting the following error.
uninitialized constant Addres
This error occured while loading the following files:
addres.rb
How do I resolve this issue.
Thanks
Silvy MAthews
2006 Mar 08
3
email signup/splash page
Does anyone know the easiest way to put up a splash page where people can
add their email addresses to be notified when the site is ready? I want
regular visitors to be directed to this page. How can i have this and still
be able to test/develop the site?
I know a lot of web apps do this while still developing, so i''m looking for
a solution that i''m sure exists, but i cant
2006 Dec 20
4
undefined method `fullname' for #<User:0x357e380>, BUT works on first view?
Hi all,
Please excuse the long post, but I wanted to make sure you have all the
information....
I have a NewsModel that looks like this:
class News < ActiveRecord::Base
belongs_to :user
validates_associated :user
validates_length_of :title, :description, :minimum => 5, :allow_nil
=> false
acts_as_commentable
acts_as_taggable
def self.find_recent
News.find(:all,
2008 Jan 18
8
link_to problem
hi @ all
I create a new archiv.html.erb and a archiv method in the controller.
Now, I would like to link from index.html.erb to archiv.html.erb. I
tried to use <%= link_to ''archive'', archiv_xxx_path %> but it doesn''t
run.
It appears a error message "SyntaxError in xxx#index".
Does anyone know, how I can enhance this problem?
thanks a lot...
--
Posted
2007 Oct 23
10
How is everyone structuring stories?
Bleeding-edge story-writers,
How are you structuring your specs?
I am working on a new project and tried this:
./lib
./blah
./spec
./blah
./stories
But it breaks autotest, so I moved stories parallel to lib and spec.
Also what about suffixes?
I have adopted "xyz_story_spec.rb", and "xyz.story" for the time
being, with the line
runner =
2007 Feb 26
15
drbspec - "no server running"
At times I''ve gotten the message "No Server Running" from drbspec
with my rails app. The thing is, the drb server certainly is running!
This happened a few times with my model specs. I''m not sure exactly
what the problem was there - I believe I was loading up fixtures that
didn''t exist. I was calling fixtures :singular_table_name as opposed
to
2006 May 02
1
Accessing Parameters - Params (nil)
I''m trying to render a component that pulls information based on a
parameter that is passed by a link_to item, but my params object is nil
for the following code in the controller:
records = ControllerName.find(params[:id])
but the error page also has this: Parameters: {"id"=>"7"}
I''ve tried to access it (in the controller) using:
variable =