Displaying 20 results from an estimated 2000 matches similar to: "undefined method `name' ..........."
2008 Jan 06
8
ActionController::InvalidAuthenticityToken
Ruby noob here.
Just installed Rails 2.0, and am having trouble with updating DB
tables, using the ApplicationController.
My ApplicationController file looks like:
class StoryController < ApplicationController
protect_from_forgery :only =>
[:create, :update, :destroy]
scaffold :story
#def index
#@current_time = Time.now
#@story =
2008 Dec 20
3
undefined method `stories_path'
Hi,
I recieve error "undefined method `stories_path'' for
#<ActionView::Base:0x995b4ac>" when going to the view via
site.com/stories/new
The model is setup correctly, I can retrieve data from the db fine. I
think it might be related to the helper but I have no idea where to
start. It seems to think its failing on the first line of the view, i
belive on the
2008 Jul 16
2
Error when running my unit test...
Hi Rails team
Learning ROR, and is doing the chapter with test..... feel like
skipping this, but....
(using NetBeans IDE 6.1)
I have created this story_test.rb, and when I run the ''rake test:units
(selected from the GUI), I get this error:
(in /data/NewOrder/Projects/ROR/shovell)
** Invoke test:units (first_time)
** Invoke db:test:prepare (first_time)
** Invoke environment
2006 Apr 20
7
Rails + postgres case insensitive searches.
Hello all
I am wondering how rails handles case sensitivity in databases. If I
do a Person.find_all_by_name("tim") in mysql I would expect to get
tim, TIm, and Tim. Do I only get tim in postgres?
How do other people deal with this? Do you resort to find_by_sql for
all your postgres queries to get case insensitive results?
2008 May 22
9
Retrieving Mutliple Records using find_by_*
I was hoping that AR''s find_by_* magic methods would help me retrieve
multiple items somewhat like the following:
names_to_find = [''Larry'', ''Moe'', ''Curly'']
found_people = Person.find_by_name(names_to_find)
Is there a way to accomplish this using find_by_* (or even find(:all)
using some sort of conditions) or must I resort to SQL
2009 Oct 19
9
Can (should) each :user have his own table?
I was reading this article a while back
http://www.sitepoint.com/blogs/2008/06/06/did-rails-sink-twitter/
and it got me thinking. If I wanted to set up my app so that each
user has his/her own table, how would I go about doing that?
"create_table :users" just creates a table in the database for a list
of all the users (which I guess I''d want in addition to their
individual
2010 Mar 05
15
Three submits, one controller
I have a ''new'' page with a submit for creating stories. On the ''show''
page the submit allows a user to enter comments. I now want a ''edit''
page for the stories with another submit for updates. I have used the
''create'' and ''update'' methods in the stories_controller on the ''new'' and
2006 Jan 16
2
acts_as_tree with Modified Preorder Traversal?
Has anyone extended Rails''s acts_as_tree to use the Modified Preorder
Traversal algorithm? This is a really clever trick for optimizing
access to trees stored in databases, as described lucidly in this
article:
http://www.sitepoint.com/article/hierarchical-data-database/2
It adds two integer fields, a "left counter" and "right counter", to
each row. By
2013 Aug 29
4
linkedin gem
Hi,
I am following this post *
http://www.sitepoint.com/ruby-social-gems-linkedin/* for using linked gem
and API for getting profile and other stuff
But at the end I am getting this error:
=> Booting WEBrick
=> Rails 3.2.13 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
2011 Feb 07
2
Confused
Hi
Im confused by one thing, and if someone can explain it I would be a happy
> rev(strsplit("hej",NULL))
[[1]]
[1] "h" "e" "j"
> lapply(strsplit("hej",NULL),rev)
[[1]]
[1] "j" "e" "h"
Why dossent the first one work? What is it in R that "fails" so to say that
you need to use lapply for it to get
2009 Apr 07
4
/lib daemon folder: how do i add a module into the daemon?
I am using the daemons plugin.
I have just one problem how do i add modules from the /lib folder to
the /lib/daemons/daemon.rb file
eg. /lib/basic_functions.rb
this is the file i want to load in daemon.rb
contents daemon.rb:
#!/usr/bin/env ruby
# You might want to change this
ENV["RAILS_ENV"] ||= "production"
require File.dirname(__FILE__) +
2007 Jun 13
6
ActiveRecord query using association
Hello all,
I apologize if the answer to this question is going to be rudimentary,
but I am thus far stymied by the information I have found on the web.
This seems like it should be simple, but I haven''t really found an
example of how to do this yet.
I have a model called Account which has a belongs_to reference to
another model, User, as below:
class Account < ActiveRecord::Base
2023 Jun 21
4
[PATCH 01/79] fs: add ctime accessors infrastructure
struct timespec64 has unused bits in the tv_nsec field that can be used
for other purposes. In future patches, we're going to change how the
inode->i_ctime is accessed in certain inodes in order to make use of
them. In order to do that safely though, we'll need to eradicate raw
accesses of the inode->i_ctime field from the kernel.
Add new accessor functions for the ctime that we can
2006 Jan 12
0
RE: re: Good OOP and JS books / tutorials?
You could also check out the following tutorials.
I found these pretty helpful.
SitePoint Articles:
http://www.sitepoint.com/print/oriented-programming-1
http://www.sitepoint.com/print/oriented-programming-2
Thank you,
Mandy.
2007 Feb 13
1
observe_field and select box
Hi everyone,
I am a newbee in RoR and i could use some help. I have a select box
populated by:
<select name = "test_company" id = "test_company">
<option selected value=test.company.to_s>Create New </option>
<%= options_for_select Company.find(:all,
:conditions => ["name =?", test.company],
:order => "id asc").collect{|c|
2008 Jan 21
1
JavaScript book recommendations
No, not a question, but a few suggestions.
I take it that everyone serious about using Prototype & Co. already has
Christophe''s (Porteneuve) Prototype and Script.aculo.us book. Apart
from that, I''d like to point out two new, library-agnostic books:
Cameron Adams and several others
The Art & Science of JavaScript
Sitepoint 2008
http://www.sitepoint.com/books/jsdesign1/
2023 Jan 18
9
remove most callers of write_one_page v3
Hi all,
this series removes most users of the write_one_page API. These helpers
internally call ->writepage which we are gradually removing from the
kernel.
Changes since v2:
- more minix error handling fixes
Changes since v1:
- drop the btrfs changes (queue up in the btrfs tree)
- drop the finaly move to jfs (can't be done without the btrfs patches)
- fix the existing minix code to
2006 Jan 11
2
Good OOP and JS books / tutorials? Looking to teach my team
Can anyone recommend good books, online tutorials, or any other learning
materials for Javascript - specifically Object Oriented Programming using
JS?
I want the rest of my dev team to be able to help me code in JS,
specifically using prototype and scriptaculous. I''ve been using JS for so
long, and I kinda "grew up" on OOP programming but my whole team is
Coldfusion
2001 Aug 13
1
export-problem
Hello!
I am trying to export a data-file from SAS to R. It says in the R program
that the SAS file should be in XPORT-format. I assume that the file should
have and .xpt extension. But when I try to open the file in R I get only
the message "compressed" written all over. So, probably I should
un-compress the file in the R-program, the question is how?
Very greatful for quick help!
2006 Feb 14
4
Fine grained access control
Hi,
I''m building an application which is going to require quite fine grained
access control. Deciding if a user is allowed to access an action will
probably require checking quite number of different rules, so a simple
role-based system won''t be flexible enough.
The approach I think I will try first is, if it''s possible, to ignore
permission issues inside the