Displaying 19 results from an estimated 19 matches for "posts_control".
2007 Mar 04
0
Syntax Error??
I wanted to make a ''simple blog'' refer to "Creating a weblog in 15
minutes" on rubyonrails.org
I made controller named post, and model named posts and started again
Webrick server
but , ther was a error like this ->
SyntaxError
app/controllers/posts_controller.rb:1: Invalid char `\357'' in
expression
app/controllers/posts_controller.rb:1: Invalid char `\273'' in
expression
app/controllers/posts_controller.rb:1: Invalid char `\277'' in
expression
RAILS_ROOT: script/../config/..
This error occured while loading the following fi...
2013 Jan 12
1
showing posts in blog
...------------------------------
ActiveModel::MassAssignmentSecurity::Error in PostsController#create
Can''t mass-assign protected attributes: text
Rails.root: C:/Users/Josh Koloff/Desktop/Programming Stuff/Rails
Stuff/blog
Application Trace | Framework Trace | Full Trace
app/controllers/posts_controller.rb:43:in `new''
app/controllers/posts_controller.rb:43:in `create''
Request
Parameters:
{"utf8"=>"✓",
"authenticity_token"=>"KFFrINOVA60MGYf0K3reYLxTFklrkC9uCiLMq2QVQpo=",
"post"=>{"name"=>"",...
2008 Sep 19
1
Help with best approach(fairly easy question)
Hello!
Well this is maybe a fairly easy question. I am writing an app where
users that belong to a group have their own blog where they can make
posts. I have a posts_controller with all the CRUD operations and my
index action shows all the posts from all the users on a group. The
route is:
users/1/posts
The thing is that I want to show too, all the posts from any user, or
all the posts for a given tag or category. So my question is, which
option should I use:
1) Sho...
2006 Mar 15
5
acts_as_threaded - help ???
...cts_as_threaded plugin with
postgresql?
I''m using rails 1.0 and ruby 1.8.4 on linux.
Following the screencast on
http://www.railtie.net/articles/2006/02/05/rails-acts_as_threaded-plugin ,
I got to where we''re ready to create our first post, having made the
changes to controllers/posts_controller.rb, views/posts/_form.rhtml,
views/posts/show.rhtml, and models/post.rb as shown in the screencast.
When I submit the post I get an SQL error:
PGError: ERROR: null value in column "root_id" violates not-null constraint:
INSERT INTO posts ("name", "updated_at", &qu...
2006 Mar 04
4
Submitting data to two different tables with two different models
I''m very new to Rails. I''ve been reading Agile Web Dev for a while and read
up on ruby, but I''m still learning.
I designed a website for someone for an engineering shop. New projects had
to be added manually.
Well, I figured this would be a great canidate for railifying! I have the
form working perfectly, you can add your data and get it in a table, and
listing
2012 May 23
1
received unexpected message :id= with (20)
...t: {title: ''New post'',
Mock Post(id: integer, title: string, description: text,
location: string, created_at: datetime, updated_at: datetime, status:
string, tags: string, views: integer, user_id: integer) received
unexpected message :id= with (20)
# ./spec/controllers/posts_controller_spec.rb:56:in `block (4
levels) in <top (required)>''
Finished in 0.59991 seconds
6 examples, 1 failure
I''m trying to figure out this for about a week or more :(
Attachments:
http://www.ruby-forum.com/attachment/7429/posts_controller_spec.rb
http://www.ruby-forum.com/...
2006 Aug 07
0
deployment failures with sqlite3
...troller/pagination.rb:172:in
`count_collection_for_pagination''
/vendor/rails/actionpack/lib/action_controller/pagination.rb:196:in
`paginator_and_collection_for''
/vendor/rails/actionpack/lib/action_controller/pagination.rb:129:in
`paginate''
/app/controllers/posts_controller.rb:13:in `list''
/app/controllers/posts_controller.rb:3:in `index''
/vendor/rails/actionpack/lib/action_controller/base.rb:910:in
`perform_action_without_filters''
/vendor/rails/actionpack/lib/action_controller/filters.rb:368:in
`perform_action_without_bench...
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
2011 Dec 02
2
problem setting expectation for test with delayed::job
...gt; new_post(post_attributes).attributes }
ArgumentError:
Cannot enqueue items which do not respond to perform
# ./app/observers/post_observer.rb:12:in `after_create''
# ./app/models/post.rb:156:in `set_state_to_open_for_free_requests''
# ./app/controllers/posts_controller.rb:39:in `create''
# ./spec/controllers/post_controller_spec.rb:8:in `do_post''
# ./spec/controllers/post_controller_spec.rb:77
# ./spec/controllers/post_controller_spec.rb:75
Patrick J. Collins
http://collinatorstudios.com
2007 May 30
18
autotest and rspec_on_rails not happy
Hi,
I''ve been using the rspec and rspec_on_rails plugins quite happily on
my Rails project for a while now. Today I noticed the autotest
support in RSpec-1.0.3 and decided to give that a spin.
Oh tragedy!
$ autotest
loading autotest/rails_rspec
./vendor/plugins/rspec_on_rails/lib/autotest/rails_rspec.rb:33:in
`initialize'': undefined method `singularize''
2006 Feb 24
4
too many components?
okay.
on /posts/show/13
i have show.rhtml, which does
render_component(:controller=>''comments'', :action=>''display_comments'',
:id=>post.id)
on comments/display_comments
i iterate through the comments and then, display_comments.rhtml
render_component(:controller=>''comments'', :action=>''new'', :id=>@id)
2012 Apr 09
8
Rails Functional Testing Problem
I''m trying to run some functional tests on Rails. However I am coming up
with the following error.
RuntimeError: Called id for nil, which would mistakenly be 4 -- if you
really wanted the id of nil, use object_id
app/controllers/posts_controller.rb:11:in `create''
posts_controller_test.rb:5:in `test_should_create''
Here is my test file
require File.dirname(__FILE__) + "/../test_helper"
class PostsControllerTest < ActionController::TestCase
def test_should_create
post :create, :post => { :message...
2007 Dec 22
8
Rails 2.0 rescue_from
I am trying to use the new Rails 2.0 macro : rescue_from
class PostsController < ApplicationController
rescue_from ActiveRecord::RecordNotFound, :with => :deny_access
...
def show
@post = Post.find_by_id(params[:id])
raise ActiveRecord::RecordNotFound if @post.nil? #illegal access
.....
end
def deny_access
respond_to do |format|
format.html
end
end
but the
2010 Jul 25
0
You can't set a constant with namespace in the initializers?
Help! in my rails controllers, there is a ''Admin'' namespace. (My the
structure of the controllers dir is like this :
app/controllers:
home_controller.rb
...
admin/posts_controller.rb
admin/pages_controller.rb
The ''Admin'' will automatically become a Module constant (I know it
from the console: ''puts Admin => Module'');
And in my initializers, ther is a init.rb which has codes like this:
Object.const_set(''A'', '&...
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 want to move on to Rails 3, and it all falls
apart...
In application.rb I have
config.autoload_paths += Dir["#{config.root}/app/models/**/"]
So Rails should be able to find the models. Ho...
2011 Feb 20
3
ugly url form_tag
Hi all
I am using form_tag helper and everything is sent by the get method.
In the url looks like :
http://localhost:3000/posts?utf8=%E2%9C%93&search=rails
The utf8 attributes is pretty much ugly.
Is there a way (in Rails 3) the url looks like something like :
http://localhost:3000/posts/search/rails
If yes what do I need to change in my code ?
Here is my code
<% form_tag posts_path,
2011 Jul 27
20
Rails, jquery and Ajax
How do I make an ajax call and then update a div with a partial? I''ve
tried this but it''s not working. Comment is created but the partial is
not loaded.
//view
<a href="#" id="testlink">Testlink</a>
<div id="commentlist">
</div>
//controller
def new
@comment = Comment.new
@comment.save
2005 Aug 08
7
Problems with ./scripts/generate scaffold
Hi all,
I''m new to rails after having used perl for most of these things, and am
trying to get my head around the generate script for a project playing
around
with.
If I do:
./scripts/generate controller Device
I get app/controllers/device_controller.rb
where I can then add:
scaffold :device
However, if I want to actually generate the scaffolding so I can make
some changes:
2007 May 31
16
Could anyone please help with rspec/nested resource behavior checking?
My problem has been listed here:
http://railsforum.com/viewtopic.php?pid=25439#p25439
Don''t think it would be required to completely re-type it here :)
Thanks!
--
-Daniel Fischer
http://danielfischer.com - Geek Blog
http://abigfisch.com - Portfolio
http://writersbeat.com - Writing Community