Displaying 20 results from an estimated 50000 matches similar to: "Rails 2.1 - when PostsController is present, creating Admin::PostsController fails"
2011 Apr 30
8
"uninitialized constant PostsController::Post"
This time i read scaffold tutorial very carefully and finally try to
generate a form without using the scaffold(just used a controller and
view ).what i have done till now ,is as follow.Using rails 3.0.7.
"rails generate controller posts
index"
1) post_controller.rb
class PostsController < ApplicationController
def index
@post=Post.new
2008 Feb 21
1
Creating incorrect plurals when generating scaffold
Preface: I''m trying to find my way through the "Build Your Own Ruby on
Rails Web Application" book. I''m completely new to programming and am
having a hard time figuring out the differences between rails 2.0.2 and
what''s in the book so please forgive me if this is a stupid question.
I''m confused because I finally thought I''d figured out the
2006 Sep 08
2
rails equivalent to symfony admin generator?
I''m an experienced PHP programmer (don''t know Ruby yet), and I''m playing
around with Symfony (PHP MVC framework similar to Rails) and I found
myself asking if there''s really any reason to use it over Rails.
From what I''ve seen just about every feature in Rails is superior except
one very important thing - Symfony''s admin generator. This is
2008 Jul 07
3
How to get a users screen name into a hidden field in a PostsController action?
Instead of the user entering a name, I want to pass their screen name
along with supplied :title and :content fields. here is what I''ve
got..
f.hidden_field :author, user.screen_name
here is the create method from Posts controller:
def create
@title = "Gravity"
@user = User.find(params[:id]) # this does not work, and I don''t
know why
if request.post?
2011 May 09
0
rails guides - getting started - section 10 security
The example doesn''t work as described for me; not sure if I haven''t
followed it right, or there''s a problem with the code. Can someone
help me to determine what the problem is.
Specifically, after adding the authentication code to the
PostsController, with this line:
before_filter :authenticate, :except => [:index, :show]
The guide says that "we want the user
2011 May 19
0
Unable to find the image path via file system using the paperclip plugin through the get method
Hello all,
with great difficulty , I guess I have finally been able to find the
appropriate git commit of paperclip which would suit my project''s config
which is Ruby 1.8.7 and rails 2.0.2.
I am trying to implement a POC before I integrate paperclip in my
project. The POC is basically implementing each post with an appropriate
image beside it. It seems to pretty much work, its just
2006 Feb 26
4
Newbie rails woes - the 'Recognition failed for “/admin”' thing
I''m working with the agile rails book (latest rev), and have encountered more
show stoppers than I woud have expected. The lastest one is rather worrying.
Page 57 is somewhat notorious for breaking. There are all sorts of blogs etc
about breakage and fixes since roughly Nov 05.
Rails 0.14.1 and the Broken Depot
Steel rails through my skull
Even back then, the breakage was known and
2007 Jul 06
0
Removing One Element From a Serialized Form
Hi all,
I''m trying to serialize a form with the exception of one specific
element.
Serializing the form in a hash (without pulling out specific elements)
works:
<li>
<%= link_to_remote ''(Save)'', {:url => post_path(@post), :with => "$
(''post_form'').serialize(true)" }, :method => :put %>
</li>
The generated code
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
2008 Sep 14
2
Postgres adapter issues with Rails 2.1: ruby-pg is the answer!
While upgrading Rails 2.0.2 sites to Rails 2.1.1, I encountered a
weird postgres adapter problem. Although the old postgresql adapter
(aka ruby-postgres) works fine with Rails 2.1.1 on my Mac dev box
(running PG 8.2.6) and also works fine with Rails 2.0.2 apps on a
Debian etch staging server (running PG 8.2.1), this error occurs when
trying to cap deploy 2.1.1 apps on the Debian box:
2008 Jun 13
2
public/.htaccess missing from Rails 2.1?
I just started with rails and have been using rails 2.0.2 up until
today. I did a gem install of Rails 2.1 and I noticed that when I
created a new project with: rails -d mysql projectname, I don''t have
a .htaccess file any longer to tell Apache to execute the fcgi or cgi
scripts... Is this on purpose or did I do something wrong?
--~--~---------~--~----~------------~-------~--~----~
You
2008 Jun 13
2
Rails 2.1: invalid date automatically convertion
Hi all,
Rails 2.1 seems to converts the following parameters
{''birth(1i)''=''1990'', ''birth(2i)''=>''2'', ''birth(3i)''=>''31''}
into date ''1990-03-02'' automatically.
Is it able to inhibit this convertion?
--
makoto kuata
2011 Aug 04
1
Creating form for associated has_many model
This example shows how to create a form for an associated model
''Comment'', where ''Comment'' belongs_to ''Post'' and ''Post has_many
''Comments''.
http://edgeguides.rubyonrails.org/getting_started.html#generating-a-controller
How might I modify that to display all the comments in the form, and
still have it call the
2007 Jul 31
0
Edit not working with named routes
HELP! I''m a relatively new rails user and I''m stuck. I''m trying to
build a relatively simple blog and I decided that I liked the way
named routes look in the code. So I added
map.resources :posts
to my routes.db file. I then went through and updated my controller to
take advantage of the named routes that were generated. I also updated
all of my views and everything
2008 Jan 31
1
New Rails Generator: Stage
I''ve just completed a new generator called stage.
This generator was based off of the scaffold generator included with Rails
2.0.2. Along with the helper, it uses form and data partials to DRY up the
view code. There were also some minor tweaks such as humanizing titles and
such.
More details at:
http://blog.stonean.com/2008/01/generator-stage.html
Hope someone finds this useful.
2012 Feb 07
6
nested route not receiving :id parameter within controller spec
I''ve got a share method in my controller, and I have the following spec:
describe PostsController do
describe "#share" do
it "doesn''t blow up" do
post :share, :id => @post.id
end
# ... etc
And... It blows up!
Failures:
1) PostsController#share shares
Failure/Error: post :share
2008 Jun 15
5
Ruby on Rails 2.1 Tutorial
Hi,
I have put all the basic things in place and you will find it a working
tutorial for Ruby on Rails 2.1.
http://www.tutorialspoint.com/ruby-on-rails-2.1/
I have covered Model, Controller and Views in detail and you will find a
nice example on scaffolding.
If you like this tutorial then please share it with others....Oh
yes...if you have any feedback then please definitely send it to me.
2012 Mar 26
1
Models in sub-folders in Rails 3
I have a Rails 2 project in which models are in sub-folders, but not in
a name space
app/models/sub_folder/posts.rb
class Post < ActiveRecord::Base
end
The controllers are also in sub-folders, but are name spaced (views also
in a corresponding sub_folder).
app/controllers/sub_folder/posts_controller.rb
class SubFolder::PostsController < ApplicationController
end
This works fine, but I
2008 May 21
2
Scaffolding and ActiveRecord in Rails 2
Hi,
Is is possible to add this constraint: "null => false" and "limit => 45"
like below:
create_table :movie do |t|
t.string :name, :null => false, :limit => 45
end
...just by using this kind of scaffold command (on Rails 2)?
$ ruby script/generate scaffold Movie name:string
Thanks,
D.
--
Posted via http://www.ruby-forum.com/.
2008 Jun 10
7
ActionMailer undefined method `parameters' - Rails 2.1
Hello Rubyists,
I''m currently trying to get email hooked up via ActionMailer, and while
I''ve gotten it to work in the past on Rails 1.2.x, I''m seeing an error
that I''m unfamiliar with.
Right now, I''m just trying to send email from my dev box via the SMTP
server at work.
My development.rb file:
#...snip
config.action_mailer.delivery_method = :smtp