Displaying 20 results from an estimated 11000 matches similar to: "getting error Unknown method 'new' for a new model instance"
2007 Apr 16
6
How to use a form.check_box ?
Hey guys,
I''m trying to have a simple webform in my administration section to
add a user. I have the text_fields for adding the user''s name,
password, and password confirmation, but cannot seem to figure out the
checkbox. I want it to be a single checkbox, that if clicked, will set
the database column "access" to be "admin" and if its unchecked, set
it to be
2009 Jan 20
4
Shared templates across controllers
Hey all,
Here''s my situation: I have a pair of controllers with associated
models (called Services and Testimonials) that are quite similar.
Because their CRUD behavior is executed via AJAX, the "templates" for
the actions are all short .rjs files. Now, because of the similarity
of the models, most of the templates are exactly the same, with only
the object names changed. That
2007 Dec 04
7
REST bug with form_for
Hi all, I am running on Windows XP sp2 with ruby 1.8.6, and rails
1.2.3
I am using REST, and have this in my view
<% form_for(:project,
:url => project_path(:user_id => @project.my_user, :id =>
@project),
:html => {:method => :put}) do |f| %>
The browser correctly gives
<form method="post" action="/users/2/projects/1">
2007 Apr 10
10
Could eBay be built with Rails?
My friend and I (both new to RoR) were having a discussion today about
whether or not you could build an exact replica of eBay using on Ruby
on Rails. I think that it could in fact be done, or at least a very
close model of the same concept. My friend seems to think that maybe
in fact, it could not be done.
What are your thoughts? Could an eBay clone be built using only Ruby
on Rails? What do you
2009 May 05
4
modalbox rails var interpolation
Howdy everyone.
I am using modalbox which is very nice an easy to use. I have this
for an edit for a company listing:
<td><%= link_to(''Manage Companies'', {}, :onclick => ''Modalbox.show(\''/
companies/edit/#{company.id}\'', {width: 600}); return false;'') %></td>
The link is not putting the company.id in it puts #{
2007 Jun 28
7
new to rails... suitable for what I wanna do?
Hi,
I have created and now maintain the website ratsdeville.com (http://
ratsdeville.com/index_e.html for english) for my brother. He creates
more and more content for it each week and I''m seriously feeling the
pain now archiving everything manually and making sure that links
works once items are archived (which I lost control of).
Like you can see, it is basically a news site about art
2007 Jun 21
11
one-to-one, compound primary key, naming conventions
My understanding is that, given tables Alpha and Beta that the table
which holds the 1-to-1 relation will be called Alpha_Beta (or is it
alpha_beta?). So far so good.
alpha_beta will have, lets say, two fields: alpha_id and beta_id. Seems
that it''d be a good idea for those two fields to form a compound primary
key, ensuring there are no duplicates.
However, RoR doesn''t
2009 Mar 13
7
rails, passenger, and images
Just switched over to passenger for development and production for my
rails app. Liking it so far.
My problem is my image_links, stylesheet_tag_links, and
javascript_tag_links are all adding "http://localhost:3000 to the
generated links. I got around the stylesheet and js links by not using
the helpers.
I can access my all of my assets directly via http://dating.local/stylesheets/all.css,
2011 May 27
14
[rails] undefined method `model_name' for NilClass:Class
Never seen the error above before, code:
describe "edit action" do
it "edit action should render edit template" do
food = Food.create(:name=>''mooo'') #
Food.any_instance.stubs(:valid?).returns(true)
get :edit, :id => food.id
response.should render_template(:edit)
end
end
-------------- next part
2010 Aug 18
6
Once I added this HABTM, one of my 'through' relationships, on a non-habtm model, seems to have broke?
I''m a rails newb and have been Googling about this, but I''m still stumped.
Not showing everything here, but basically it should be a pretty common
setup so I''m sure others know what I''m doing wrong.
- A meter can belong to many meter_groups
- A meter_group can have many meters.
- A user can ''subscribe'' to viewing a meter_group (Subscription)
2008 Jan 18
15
scaffold :product missing in Rails 2.0.2 version of depot tutorial?
I am getting an error when I try to run the code for the depot
application (page 67 in the Agile Web Development on Rails book, 2nd
edition). I built the complete depot app with Rails 1.2.6, and all
worked well. I then updated to Gem 1.0.1 and RoR 2.0.2, and attempted
to repeat the tutorial, and got this strange behavior.
I used "rails depot --database=mysql" because I have not
2007 Oct 24
6
how to subclass active record to call a method on all save and destroy actions
I''m looking for a way to subclass active record (I''ll refer to the
subclass I want to create as NewActiveRecord) so that I can call
different methods on a save or destroy action on all models which sub
class NewActiveRecord
I dont want to use before_save or any of the other regular call back
methods as I want to be able to use these call backs in the models
which subclass
2006 Feb 21
3
controller subroutines
Trying to find this documented in the Agile book and don''t see an
appropriate example so I am confused.
I have a method in my controller...
def performfind
myfind = ["Select * from clients where ..."]
even more...complicated find here
end
and within the controller, I want to use the ''myfind'' string
How do I get the string back from the method
2009 Dec 06
3
link_to_function or button_to_function memory usage
I have an full ajax app doing crud operations for contact info for one
section. I was using ajax calls to edit and cancel and also to add a
contact. I am implementing a button_to_function instead of doing an
ajax call to just edit/add/or cancel a contact. I am running into a
memory issue using the button_to_function or link_to_function.
I have this:
<%= link_to_function ''Edit
2010 Apr 14
4
module/class question
Are these two below the same thing?
1. module X
module Y
class Z
2. class X::Y::Z
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
2007 Apr 02
19
Pref for beginner book: Wrox (Holzner) or Ruby for Rails?
I''m a beginner. I''ve done the apple tutorial, Agile ROR (the depot
app, I stopped after that, a little to advanced with no base knowledge
of Ruby), Why''s guide and my copy of Chris Pine''s book today. After
Pine, I''m going to buy either the Wrox book or Ruby for Rails book. I
did a search and there''s not too much on the Wrox book (Holzner)
2007 Nov 08
5
Rails byte-range request support
Hi,
I''m trying to serve the iPhone a video file from my controller using
send_file. However, it appears as thought the iPhone requires byte-
range request support and rails doesn''t seem to support this.
If I give the iPhone a url that points to an actual file (i.e. it''s
served by my webserver nginx, instead of rails) it downloads and plays
it fine.
Here is the proof
2007 Oct 30
5
Using UUID in a Migration
Has anyone ever used UUID in a migration?
I thought I could set the default value of a field to be UUID but that
only sets the value the string instead of executing the function to
create a new unique identifier.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
2010 Jul 23
7
fail rollback transaction with manual raise exception
With :
PostgreSQL 8.4 or postgresql-8.3
rails 2.3.4
pg 9.x or pg 8.x
I test this code:
=========================
class NkiBatch < ActiveRecord::Base
Bank.connection.transaction do
bank = Bank.new(:name => "ddsjdsjdsjk")
bank.save!
raise ActiveRecord::Rollback.new
end
end
and this:
=========================
class NkiBatch < ActiveRecord::Base
2015 Aug 06
4
2nd DC, internal DNS: dns_tkey_negotiategss: TKEY is unacceptable
Hi everyone,
I'm testing with a Samba4 AD network, and I have some problems with DNS on
the second DC, with which I could use a bit of your help.
I have an AD with two DC's, both Samba 4.2.3. On the first DC,
samba_dnsupdate works fine. With stock 4.2.3 I get the error
"TSIG error with server: tsig verify failure"
but the DNS updates succeed anyway, and after applying