You are here: Forums Ask a Rails expert First post, requesting sage pe...
Posted in Forums : Ask a Rails expert
Authority 12
Posting Rating 0
Sign in to rate this post
|
Hello, I’m working on a basic app for learning purposes. Nothing critical, but I’m not meeting much success asking for help on railsforum.com. It’s a very simple juncture (for an expert). I’ve got a /post page with shows a list of entries, and a /post/create page for people to create entries. Mainly I’m trying to figure out how to redirect from /post/create (post created) to /post—with the correct flash notice. Also how to customize the flash notice color scheme for success / error. I do need help with this problem, but more than that, I need good, clear direction on how to proceed into the more complex functionalities. Thank you :-) ==================
end ================== ================== |
Authority 12
Posting Rating 0
Sign in to rate this post
|
Goof. I changed post_path to ’/post’ and the successful message works. I guess I’m trucking when I get help with validating each param. I put ‘validates_presence_of :author … etc. before the method listings? Is there a better way than using a string literal for ‘posts_path’ ? Thanks. |
Authority 12
Posting Rating 0
Sign in to rate this post
|
the following does not seem to work, but I am able to browse to the /post page and see the “please comlete all fields” message. The error, each time I enter a comment without one of the attributes follows the Post model. class Post < ActiveRecord::Base
end
Showing post/create.haml where line #7 raised: undefined method `title’ for false:FalseClass Extracted source (around line #7): 4: – form_for(:post, :url => { :action => “create” }) do |f| |
|
Authority 12
Posting Rating 0
Sign in to rate this post
|
if you deal with RESTfull controllers, the code should looks like the following
this way you will get the @post object of the Post class on the form. |
Ask a Rails expert : json gem error
Ask a Rails expert : Problem with break
Ask a Rails expert : activesupport string first method error
Ask a Rails expert : url_for broken ?
Ask a Rails expert : map.routes.rb pls help
Ask a Rails expert : how to h tag in controller
Ask a Rails expert : Problem with Restful routing and partial form
Ask a Rails expert : will_paginate, search and ajax
Ask a Rails expert : Mass Deletes in Admin Section