I tried to generate a form it says "undefined method `posts_path'' for #<#<Class:0xb6784798>:0xb67817f0>" The following code at line number 2 gives the error. <%= link_to ''New Post''%> <%= form_for(@post) do |f| %> <div class="field"> <%= f.label :name %><br /> <%= f.text_field :name %> </div> <div class="field"> <%= f.label :title %><br /> <%= f.text_field :title %> </div> <div class="field"> <%= f.label :content %><br /> <%= f.text_area :content %> </div> <div class="actions"> <%= f.submit %> </div> <% end %> John -- 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 rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On May 20, 2011, at 10:22 AM, John shelfer wrote:> I tried to generate a form it says "undefined method `posts_path'' for > #<#<Class:0xb6784798>:0xb67817f0>" > The following code at line number 2 gives the error. > > > <%= link_to ''New Post''%> > <%= form_for(@post) do |f| %> > <div class="field"> > <%= f.label :name %><br /> > <%= f.text_field :name %> > </div> > <div class="field"> > <%= f.label :title %><br /> > <%= f.text_field :title %> > </div> > <div class="field"> > <%= f.label :content %><br /> > <%= f.text_area :content %> > </div> > <div class="actions"> > <%= f.submit %> > </div> > <% end %> > > > JohnPlease run rake routes and post that here, or just read through it and see whether posts_path is listed. What does your routes.rb look like? Walter -- 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 rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Check your routes file for the routes for *post*. If you scaffolded the model, then there should be resources :post in your routes.rb file. If the above is not there, just add the line and you will get the routes for CRUD automatically. On Fri, May 20, 2011 at 2:22 PM, John shelfer <johnsshelfer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:> I tried to generate a form it says "undefined method `posts_path'' for > #<#<Class:0xb6784798>:0xb67817f0>" > The following code at line number 2 gives the error. > > > <%= link_to ''New Post''%> > <%= form_for(@post) do |f| %> > <div class="field"> > <%= f.label :name %><br /> > <%= f.text_field :name %> > </div> > <div class="field"> > <%= f.label :title %><br /> > <%= f.text_field :title %> > </div> > <div class="field"> > <%= f.label :content %><br /> > <%= f.text_area :content %> > </div> > <div class="actions"> > <%= f.submit %> > </div> > <% end %> > > > John > > -- > 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 > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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 rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
> Please run rake routes and post that hererake routes shows posts_index GET /posts/index(.:format) {:action=>"index", :controller=>"posts"} What does your routes.rb look like? router.rb file looks like: Check::Application.routes.draw do get "posts/index" # The priority is based upon order of creation: # first created -> highest priority. # Sample of regular route: # match ''products/:id'' => ''catalog#view'' # Keep in mind you can assign values other than :controller and :action # Sample of named route: # match ''products/:id/purchase'' => ''catalog#purchase'', :as => :purchase # This route can be invoked with purchase_url(:id => product.id) # Sample resource route (maps HTTP verbs to controller actions automatically): # resources :products # Sample resource route with options: # resources :products do # member do # get ''short'' # post ''toggle'' # end # # collection do # get ''sold'' # end # end # Sample resource route with sub-resources: # resources :products do # resources :comments, :sales # resource :seller # end # Sample resource route with more complex sub-resources # resources :products do # resources :comments # resources :sales do # get ''recent'', :on => :collection # end # end # Sample resource route within a namespace: # namespace :admin do # # Directs /admin/products/* to Admin::ProductsController # # (app/controllers/admin/products_controller.rb) # resources :products # end # You can have the root of your site routed with "root" # just remember to delete public/index.html. # root :to => "welcome#index" # See how all your routes lay out with "rake routes" # This is a legacy wild controller route that''s not recommended for RESTful applications. # Note: This route will make all actions in every controller accessible via GET requests. # match '':controller(/:action(/:id(.:format)))'' end John -- 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 rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 21 May 2011 05:18, John shelfer <johnsshelfer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> >> Please run rake routes and post that here > rake routes shows > posts_index GET /posts/index(.:format) > {:action=>"index", :controller=>"posts"} > > What does your routes.rb look like? > router.rb file looks like: > > Check::Application.routes.draw do > get "posts/index" > ...Have a look at the Rails Guide on Routing to see how routing works. Read it through carefully and make sure you understand it. Then you will easily answer your question yourself. Colin -- 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 rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Sat, May 21, 2011 at 4:05 AM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 21 May 2011 05:18, John shelfer <johnsshelfer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > >> Please run rake routes and post that here > > rake routes shows > > posts_index GET /posts/index(.:format) > > {:action=>"index", :controller=>"posts"} > > > > What does your routes.rb look like? > > router.rb file looks like: > > > > Check::Application.routes.draw do > > get "posts/index" > > ... > > Have a look at the Rails Guide on Routing to see how routing works. > Read it through carefully and make sure you understand it. Then you > will easily answer your question yourself. >Ok Colin.I will.But still can you help now to resolve it? John -- 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 rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 21 May 2011 10:00, john shelfer <johnsshelfer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On Sat, May 21, 2011 at 4:05 AM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: >> >> On 21 May 2011 05:18, John shelfer <johnsshelfer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> > >> >> Please run rake routes and post that here >> > rake routes shows >> > posts_index GET /posts/index(.:format) >> > {:action=>"index", :controller=>"posts"} >> > >> > What does your routes.rb look like? >> > router.rb file looks like: >> > >> > Check::Application.routes.draw do >> > get "posts/index" >> > ... >> >> Have a look at the Rails Guide on Routing to see how routing works. >> Read it through carefully and make sure you understand it. Then you >> will easily answer your question yourself. > > Ok Colin.I will.But still can you help now to resolve it? > JohnDid you try Jatin Kumar''s suggestion? Colin -- 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 rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On May 21, 5:13 am, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 21 May 2011 10:00, john shelfer <johnsshel...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > > > > > On Sat, May 21, 2011 at 4:05 AM, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > > >> On 21 May 2011 05:18, John shelfer <johnsshel...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > >> >> Please run rake routes and post that here > >> > rake routes shows > >> > posts_index GET /posts/index(.:format) > >> > {:action=>"index", :controller=>"posts"} > > >> > What does your routes.rb look like? > >> > router.rb file looks like: > > >> > Check::Application.routes.draw do > >> > get "posts/index" > >> > ... > > >> Have a look at the Rails Guide on Routing to see how routing works. > >> Read it through carefully and make sure you understand it. Then you > >> will easily answer your question yourself. > > > Ok Colin.I will.But still can you help now to resolve it? > > John > > Did you try Jatin Kumar''s suggestion?yes i added a resource and now router.rb look likes but same issue is still there Check::Application.routes.draw do get "posts/index" resources :post # The priority is based upon order of creation: # first created -> highest priority. # Sample of regular route: # match ''products/:id'' => ''catalog#view'' # Keep in mind you can assign values other than :controller and :action # Sample of named route: # match ''products/:id/purchase'' => ''catalog#purchase'', :as => :purchase # This route can be invoked with purchase_url(:id => product.id) # Sample resource route (maps HTTP verbs to controller actions automatically): # resources :products # Sample resource route with options: # resources :products do # member do # get ''short'' # post ''toggle'' # end # # collection do # get ''sold'' # end # end # Sample resource route with sub-resources: # resources :products do # resources :comments, :sales # resource :seller # end # Sample resource route with more complex sub-resources # resources :products do # resources :comments # resources :sales do # get ''recent'', :on => :collection # end # end # Sample resource route within a namespace: # namespace :admin do # # Directs /admin/products/* to Admin::ProductsController # # (app/controllers/admin/products_controller.rb) # resources :products # end # You can have the root of your site routed with "root" # just remember to delete public/index.html. # root :to => "welcome#index" # See how all your routes lay out with "rake routes" # This is a legacy wild controller route that''s not recommended for RESTful applications. # Note: This route will make all actions in every controller accessible via GET requests. # match '':controller(/:action(/:id(.:format)))'' end John -- 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 rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On May 21, 4:22 pm, John shelfer <johnsshel...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On May 21, 5:13 am, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> > yes i added a resource and now router.rb look likes but same issue > is still there > > Check::Application.routes.draw do > get "posts/index" > resources :postresources should be plural, ie resources :posts Fred -- 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 rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On May 21, 2:45 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On May 21, 4:22 pm, John shelfer <johnsshel...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > On May 21, 5:13 am, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > > > yes i added a resource and now router.rb look likes but same issue > > is still there > > > Check::Application.routes.draw do > > get "posts/index" > > resources :post > > resources should be plural, ie resources :postsThank you very much.It worked.But now i got another error in following file ,it says "undefined method `name'' for #<Post id: nil, created_at: nil, updated_at: nil>" John -- 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 rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 22 May 2011 07:41, John shelfer <johnsshelfer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On May 21, 2:45 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: >> On May 21, 4:22 pm, John shelfer <johnsshel...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >> > On May 21, 5:13 am, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: >> >> > yes i added a resource and now router.rb look likes but same issue >> > is still there >> >> > Check::Application.routes.draw do >> > get "posts/index" >> > resources :post >> >> resources should be plural, ie resources :posts > Thank you very much.It worked.But now i got another error in > following file ,it says > > "undefined method `name'' for #<Post id: nil, created_at: nil, > updated_at: nil>"Look at the error and try and work out what it means. There should also be an indication of which line generated the error. It says undefined method ''name'', so that suggests you are calling the method name for something. It tells you that the object you are calling it on is a Post object. Have a look at your code, can you see where the error is being generated? Assuming that you can see that you are calling name on a Post object, does Post have a method called name? Assuming that Post is an ActiveRecord model then is the posts table supposed to have a name column? If so does it have such a column? Colin -- 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 rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On May 22, 2:55 am, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 22 May 2011 07:41, John shelfer <johnsshel...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > > > > > On May 21, 2:45 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > wrote: > >> On May 21, 4:22 pm, John shelfer <johnsshel...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > >> > On May 21, 5:13 am, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > > >> > yes i added a resource and now router.rb look likes but same issue > >> > is still there > > >> > Check::Application.routes.draw do > >> > get "posts/index" > >> > resources :post > > >> resources should be plural, ie resources :posts > > Thank you very much.It worked.But now i got another error in > > following file ,it says > > > "undefined method `name'' for #<Post id: nil, created_at: nil, > > updated_at: nil>" > > Look at the error and try and work out what it means. There should > also be an indication of which line generated the error.Error is generated at link 8 in following code. <%= link_to ''New Post'', new_post_path%> <%= form_for(@post) do |f| %> <div class="field"> <%= f.label :name %><br /> <%= f.text_field :name %> </div> <div class="field"> <%= f.label :title %><br /> <%= f.text_field :title %> </div> <div class="field"> <%= f.label :content %><br /> <%= f.text_area :content %> </div> <div class="actions"> <%= f.submit %> </div> <% end %> Posts_controller.rb file looks like: class PostsController < ApplicationController def try @post = Post.new end def create @post = Post.new(params[:post]) respond_to do |format| end end end John -- 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 rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 22 May 2011 08:09, John shelfer <johnsshelfer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On May 22, 2:55 am, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: >> On 22 May 2011 07:41, John shelfer <johnsshel...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>> ... >> > "undefined method `name'' for #<Post id: nil, created_at: nil, >> > updated_at: nil>" >> >> Look at the error and try and work out what it means. There should >> also be an indication of which line generated the error. > Error is generated at link 8 in following code. > > > <%= link_to ''New Post'', new_post_path%> > <%= form_for(@post) do |f| %> > > > <div class="field"> > <%= f.label :name %><br /> > <%= f.text_field :name %>Here you are asking to display (and allow entry) of @post.name, whereas the error suggests that Post does not have a method ''name''. Colin -- 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 rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On May 22, 3:15 am, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 22 May 2011 08:09, John shelfer <johnsshel...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > > > > > On May 22, 2:55 am, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > >> On 22 May 2011 07:41, John shelfer <johnsshel...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >>> ... > >> > "undefined method `name'' for #<Post id: nil, created_at: nil, > >> > updated_at: nil>" > > >> Look at the error and try and work out what it means. There should > >> also be an indication of which line generated the error. > > Error is generated at link 8 in following code. > > > <%= link_to ''New Post'', new_post_path%> > > <%= form_for(@post) do |f| %> > > > <div class="field"> > > <%= f.label :name %><br /> > > <%= f.text_field :name %> > > Here you are asking to display (and allow entry) of @post.name, > whereas the error suggests that Post does not have a method ''name''.''name'' is field that i want to generate in form.Let me tell you i have total 3 files 1)posts_controller.rb(code is above) 2)try.html.erb(/view/posts)(code is above) 3)post.rb(Model)(Empty) John -- 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 rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
You are confusing things a lot. Answer this question first: Did you scaffold the model or you are adding the files one by one writing the code by hand. 1. If you did scaffold, I don''t see a problem coming anywhere. 2. If you didn''t scaffold, then go for Colin''s suggestion and read the guides, you will understand how Rails works. AND read the guides rightnow, before you get troubled by another problem. As of the current problem that you are facing, do this: 1. Look up the database table for posts, and see if you have a column named ''name'' in there. If not, what went wrong. 2. I am quite sure, 1st would fail. Now, look up your post.rb model file and see if there is attr_accessible : name in your model file. On Sun, May 22, 2011 at 9:53 PM, John shelfer <johnsshelfer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:> > > On May 22, 3:15 am, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > > On 22 May 2011 08:09, John shelfer <johnsshel...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > > > > > > > > > > > > > > > > > On May 22, 2:55 am, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > > >> On 22 May 2011 07:41, John shelfer <johnsshel...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > >>> ... > > >> > "undefined method `name'' for #<Post id: nil, created_at: nil, > > >> > updated_at: nil>" > > > > >> Look at the error and try and work out what it means. There should > > >> also be an indication of which line generated the error. > > > Error is generated at link 8 in following code. > > > > > <%= link_to ''New Post'', new_post_path%> > > > <%= form_for(@post) do |f| %> > > > > > <div class="field"> > > > <%= f.label :name %><br /> > > > <%= f.text_field :name %> > > > > Here you are asking to display (and allow entry) of @post.name, > > whereas the error suggests that Post does not have a method ''name''. > ''name'' is field that i want to generate in form.Let me tell you i > have total 3 files > > 1)posts_controller.rb(code is above) > > 2)try.html.erb(/view/posts)(code is above) > > 3)post.rb(Model)(Empty) > > John > > -- > 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 > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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 rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On May 22, 12:57 pm, Jatin kumar <jatinkumar.n...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> You are confusing things a lot. > Answer this question first: > Did you scaffold the model or you are adding the files one by one writing > the code by hand.I didnt scaffold.I am adding files one by one.> 1. If you did scaffold, I don''t see a problem coming anywhere. > 2. If you didn''t scaffold, then go for Colin''s suggestion and read the > guides, you will understand how Rails works. > AND read the guides rightnow, before you get troubled by another problem. > > As of the current problem that you are facing, do this: > 1. Look up the database table for posts, and see if you have a column named > ''name'' in there. If not, what went wrong.In ''posts'' table there is no column for name,title and content.> 2. I am quite sure, 1st would fail. Now, look up your post.rb model file and > see if there is > attr_accessible : name > in your model file.It is not there,but after adding it there ,error didnt resolve. John -- 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 rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 23 May 2011 02:59, John shelfer <johnsshelfer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On May 22, 12:57 pm, Jatin kumar <jatinkumar.n...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> You are confusing things a lot. >> Answer this question first: >> Did you scaffold the model or you are adding the files one by one writing >> the code by hand. > I didnt scaffold.I am adding files one by one. > >> 1. If you did scaffold, I don''t see a problem coming anywhere. >> 2. If you didn''t scaffold, then go for Colin''s suggestion and read the >> guides, you will understand how Rails works. >> AND read the guides rightnow, before you get troubled by another problem. >> >> As of the current problem that you are facing, do this: >> 1. Look up the database table for posts, and see if you have a column named >> ''name'' in there. If not, what went wrong. > In ''posts'' table there is no column for name,title and content.I suggested before reading the Rails Guide on Routing. I also suggest that you read the Getting Started guide and then the others. Also work through a good tutorial (make sure it is for the version of Rails that you are using). railstutorial.org is a good free to use online tutorial. The reason is that you are missing some fundamental understanding of how Rails works. When you do form_for(@post) and then f.text_field :name rails expects @post to have a method ''name'' to get the initial value for display. Often this will come automatically from the fact that the posts table will contain a column ''name''. Since you have no such column it complains that Post has no method ''name''. Colin -- 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 rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Mon, May 23, 2011 at 3:04 AM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 23 May 2011 02:59, John shelfer <johnsshelfer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > On May 22, 12:57 pm, Jatin kumar <jatinkumar.n...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> You are confusing things a lot. > >> Answer this question first: > >> Did you scaffold the model or you are adding the files one by one > writing > >> the code by hand. > > I didnt scaffold.I am adding files one by one. > > > >> 1. If you did scaffold, I don''t see a problem coming anywhere. > >> 2. If you didn''t scaffold, then go for Colin''s suggestion and read the > >> guides, you will understand how Rails works. > >> AND read the guides rightnow, before you get troubled by another > problem. > >> > >> As of the current problem that you are facing, do this: > >> 1. Look up the database table for posts, and see if you have a column > named > >> ''name'' in there. If not, what went wrong. > > In ''posts'' table there is no column for name,title and content. > > I suggested before reading the Rails Guide on Routing. I also suggest > that you read the Getting Started guide and then the others. Also > work through a good tutorial (make sure it is for the version of Rails > that you are using). railstutorial.org is a good free to use online > tutorial.Thank you very much.I will read it now.> The reason is that you are missing some fundamental > understanding of how Rails works. When you do form_for(@post) and > then f.text_field :name rails expects @post to have a method ''name'' to > get the initial value for display. Often this will come automatically > from the fact that the posts table will contain a column ''name''. > Since you have no such column it complains that Post has no method >Because i am not doing scaffold,so can i add column values manually to table ''posts'' OR changes should be made in Model. John John> ''name''. >-- 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 rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 23 May 2011 11:20, john shelfer <johnsshelfer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On Mon, May 23, 2011 at 3:04 AM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: >> >> On 23 May 2011 02:59, John shelfer <johnsshelfer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> > >> > >> > On May 22, 12:57 pm, Jatin kumar <jatinkumar.n...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >> You are confusing things a lot. >> >> Answer this question first: >> >> Did you scaffold the model or you are adding the files one by one >> >> writing >> >> the code by hand. >> > I didnt scaffold.I am adding files one by one. >> > >> >> 1. If you did scaffold, I don''t see a problem coming anywhere. >> >> 2. If you didn''t scaffold, then go for Colin''s suggestion and read the >> >> guides, you will understand how Rails works. >> >> AND read the guides rightnow, before you get troubled by another >> >> problem. >> >> >> >> As of the current problem that you are facing, do this: >> >> 1. Look up the database table for posts, and see if you have a column >> >> named >> >> ''name'' in there. If not, what went wrong. >> > In ''posts'' table there is no column for name,title and content. >> >> I suggested before reading the Rails Guide on Routing. I also suggest >> that you read the Getting Started guide and then the others. Also >> work through a good tutorial (make sure it is for the version of Rails >> that you are using). railstutorial.org is a good free to use online >> tutorial. > > Thank you very much.I will read it now. >> >> The reason is that you are missing some fundamental >> understanding of how Rails works. When you do form_for(@post) and >> then f.text_field :name rails expects @post to have a method ''name'' to >> get the initial value for display. Often this will come automatically >> from the fact that the posts table will contain a column ''name''. >> Since you have no such column it complains that Post has no method > > Because i am not doing scaffold,so can i add column values > manually to table ''posts'' OR changes should be made in > Model.You can add them using migrations. railstutorial.org will show you how to do that. Colin -- 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 rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Mon, May 23, 2011 at 6:38 AM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 23 May 2011 11:20, john shelfer <johnsshelfer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > On Mon, May 23, 2011 at 3:04 AM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > wrote: > >> > >> On 23 May 2011 02:59, John shelfer <johnsshelfer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> > > >> > > >> > On May 22, 12:57 pm, Jatin kumar <jatinkumar.n...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> >> You are confusing things a lot. > >> >> Answer this question first: > >> >> Did you scaffold the model or you are adding the files one by one > >> >> writing > >> >> the code by hand. > >> > I didnt scaffold.I am adding files one by one. > >> > > >> >> 1. If you did scaffold, I don''t see a problem coming anywhere. > >> >> 2. If you didn''t scaffold, then go for Colin''s suggestion and read > the > >> >> guides, you will understand how Rails works. > >> >> AND read the guides rightnow, before you get troubled by another > >> >> problem. > >> >> > >> >> As of the current problem that you are facing, do this: > >> >> 1. Look up the database table for posts, and see if you have a column > >> >> named > >> >> ''name'' in there. If not, what went wrong. > >> > In ''posts'' table there is no column for name,title and content. > >> > >> I suggested before reading the Rails Guide on Routing. I also suggest > >> that you read the Getting Started guide and then the others. Also > >> work through a good tutorial (make sure it is for the version of Rails > >> that you are using). railstutorial.org is a good free to use online > >> tutorial. > > > > Thank you very much.I will read it now. > >> > >> The reason is that you are missing some fundamental > >> understanding of how Rails works. When you do form_for(@post) and > >> then f.text_field :name rails expects @post to have a method ''name'' to > >> get the initial value for display. Often this will come automatically > >> from the fact that the posts table will contain a column ''name''. > >> Since you have no such column it complains that Post has no method > > > > Because i am not doing scaffold,so can i add column values > > manually to table ''posts'' OR changes should be made in > > Model. > > You can add them using migrations. railstutorial.org will show you > how to do that. > I created migration and added following code inside and then did > "rake db:migrate" but still the same error persists.I think now it might > work,but it did not. >class CreatePosts < ActiveRecord::Migration def self.up create_table :posts do |t| t.string :name t.string :title t.text :content t.timestamps end end def self.down drop_table :posts end end John -- 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 rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 23 May 2011 11:50, john shelfer <johnsshelfer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On Mon, May 23, 2011 at 6:38 AM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: >> >> On 23 May 2011 11:20, john shelfer <johnsshelfer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> > >> > >> > On Mon, May 23, 2011 at 3:04 AM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> >> > wrote: >> >> >> >> On 23 May 2011 02:59, John shelfer <johnsshelfer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >> > >> >> > >> >> > On May 22, 12:57 pm, Jatin kumar <jatinkumar.n...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >> >> You are confusing things a lot. >> >> >> Answer this question first: >> >> >> Did you scaffold the model or you are adding the files one by one >> >> >> writing >> >> >> the code by hand. >> >> > I didnt scaffold.I am adding files one by one. >> >> > >> >> >> 1. If you did scaffold, I don''t see a problem coming anywhere. >> >> >> 2. If you didn''t scaffold, then go for Colin''s suggestion and read >> >> >> the >> >> >> guides, you will understand how Rails works. >> >> >> AND read the guides rightnow, before you get troubled by another >> >> >> problem. >> >> >> >> >> >> As of the current problem that you are facing, do this: >> >> >> 1. Look up the database table for posts, and see if you have a >> >> >> column >> >> >> named >> >> >> ''name'' in there. If not, what went wrong. >> >> > In ''posts'' table there is no column for name,title and content. >> >> >> >> I suggested before reading the Rails Guide on Routing. I also suggest >> >> that you read the Getting Started guide and then the others. Also >> >> work through a good tutorial (make sure it is for the version of Rails >> >> that you are using). railstutorial.org is a good free to use online >> >> tutorial. >> > >> > Thank you very much.I will read it now. >> >> >> >> The reason is that you are missing some fundamental >> >> understanding of how Rails works. When you do form_for(@post) and >> >> then f.text_field :name rails expects @post to have a method ''name'' to >> >> get the initial value for display. Often this will come automatically >> >> from the fact that the posts table will contain a column ''name''. >> >> Since you have no such column it complains that Post has no method >> > >> > Because i am not doing scaffold,so can i add column values >> > manually to table ''posts'' OR changes should be made in >> > Model. >> >> You can add them using migrations. railstutorial.org will show you >> how to do that. >> I created migration and added following code inside and then did >> "rake db:migrate" but still the same error persists.I think now it might >> work,but it did not.Have you worked right through railstutorial.org already? Colin -- 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 rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Mon, May 23, 2011 at 6:54 AM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 23 May 2011 11:50, john shelfer <johnsshelfer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > On Mon, May 23, 2011 at 6:38 AM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > wrote: > >> > >> On 23 May 2011 11:20, john shelfer <johnsshelfer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> > > >> > > >> > On Mon, May 23, 2011 at 3:04 AM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > >> > wrote: > >> >> > >> >> On 23 May 2011 02:59, John shelfer <johnsshelfer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> >> > > >> >> > > >> >> > On May 22, 12:57 pm, Jatin kumar <jatinkumar.n...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > >> >> >> You are confusing things a lot. > >> >> >> Answer this question first: > >> >> >> Did you scaffold the model or you are adding the files one by one > >> >> >> writing > >> >> >> the code by hand. > >> >> > I didnt scaffold.I am adding files one by one. > >> >> > > >> >> >> 1. If you did scaffold, I don''t see a problem coming anywhere. > >> >> >> 2. If you didn''t scaffold, then go for Colin''s suggestion and read > >> >> >> the > >> >> >> guides, you will understand how Rails works. > >> >> >> AND read the guides rightnow, before you get troubled by another > >> >> >> problem. > >> >> >> > >> >> >> As of the current problem that you are facing, do this: > >> >> >> 1. Look up the database table for posts, and see if you have a > >> >> >> column > >> >> >> named > >> >> >> ''name'' in there. If not, what went wrong. > >> >> > In ''posts'' table there is no column for name,title and content. > >> >> > >> >> I suggested before reading the Rails Guide on Routing. I also > suggest > >> >> that you read the Getting Started guide and then the others. Also > >> >> work through a good tutorial (make sure it is for the version of > Rails > >> >> that you are using). railstutorial.org is a good free to use online > >> >> tutorial. > >> > > >> > Thank you very much.I will read it now. > >> >> > >> >> The reason is that you are missing some fundamental > >> >> understanding of how Rails works. When you do form_for(@post) and > >> >> then f.text_field :name rails expects @post to have a method ''name'' > to > >> >> get the initial value for display. Often this will come > automatically > >> >> from the fact that the posts table will contain a column ''name''. > >> >> Since you have no such column it complains that Post has no method > >> > > >> > Because i am not doing scaffold,so can i add column values > >> > manually to table ''posts'' OR changes should be made in > >> > Model. > >> > >> You can add them using migrations. railstutorial.org will show you > >> how to do that. > >> I created migration and added following code inside and then > did > >> "rake db:migrate" but still the same error persists.I think now it might > >> work,but it did not. > > Have you worked right through railstutorial.org already? > No.I followed yet it from Agile web development with Rails (Pdf).Does > everything seems right with coding part? >John -- 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 rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 23 May 2011 15:37, john shelfer <johnsshelfer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> No.I followed yet it from Agile web development with Rails (Pdf).Does > everything seems right with coding part?It looks ok. Can you post your models/post.rb file, the error message you are getting, the stack trace, and the relevant section of code where the error is generated (I know you have posted this previously but copy it and paste it again just so we have everything together). Tell us which line in the source is the one referred to in the error. Copy from your actual files so we make sure there are no typos. If while doing this you realise that the error is not actually the same one you were getting previously then try to work it out before posting. Also check that the database does now actually contain the posts table with the correct columns. Colin -- 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 rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Mon, May 23, 2011 at 10:50 AM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 23 May 2011 15:37, john shelfer <johnsshelfer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > No.I followed yet it from Agile web development with Rails (Pdf).Does > > everything seems right with coding part? > > It looks ok. Can you post your models/post.rb file,model/post.rb file looks like: class Post < ActiveRecord::Base end the error message> you are getting, the stack trace, and the relevant section of code > where the error is generated> (I know you have posted this previously > but copy it and paste it again just so we have everything together). > Tell us which line in the source is the one referred to in the error. >In /app/view/try.htm..erb file generate error at line number 8 which is <%= f.text_field :name %>> Copy from your actual files so we make sure there are no typos. If > while doing this you realise that the error is not actually the same > one you were getting previously then try to work it out before > posting. > > Also check that the database does now actually contain the posts table > with the correct columns. >Posts table exist in database but there is no column for name,title and content even after "rake db:migrate",it couldn''t generate. John> > Colin > > -- > 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 > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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 rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Mon, May 23, 2011 at 8:06 AM, john shelfer <johnsshelfer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:>> Also check that the database does now actually contain the posts table >> with the correct columns. > > Posts table exist in database but there is no column for name,title > and content even after "rake db:migrate",it couldn''t generate.If your migration didn''t run, then how do you expect this to work any better than before? And your previously posted migration code was trying to *create* a table that apparently already exists, which is pretty much guaranteed to fail :-) You might want to read up on migrations at this point... FWIW, -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org http://about.me/hassanschroeder twitter: @hassan -- 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 rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On May 23, 11:33 am, Hassan Schroeder <hassan.schroe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Mon, May 23, 2011 at 8:06 AM, john shelfer <johnsshel...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> Also check that the database does now actually contain the posts table > >> with the correct columns. > > > Posts table exist in database but there is no column for name,title > > and content even after "rake db:migrate",it couldn''t generate. > > If your migration didn''t run, then how do you expect this to work any > better than before?But to run a migration "rake db:migrate" is right command ,still it didn''t run .why?> And your previously posted migration code was trying to *create* a > table that apparently already exists, which is pretty much guaranteed > to fail :-)Yes table already exist but migration didn''t run so columns are not added in table. John -- 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 rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On May 23, 11:33 am, Hassan Schroeder <hassan.schroe...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Mon, May 23, 2011 at 8:06 AM, john shelfer <johnsshel...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> Also check that the database does now actually contain the posts table > >> with the correct columns. > > > Posts table exist in database but there is no column for name,title > > and content even after "rake db:migrate",it couldn''t generate. > > If your migration didn''t run, then how do you expect this to work any > better than before? > > And your previously posted migration code was trying to *create* a > table that apparently already exists, which is pretty much guaranteed > to fail :-) > > You might want to read up on migrations at this point...I checked out this and it seems ok with my migration coding part http://guides.rubyonrails.org/migrations.html John -- 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 rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Mon, May 23, 2011 at 8:17 PM, John shelfer <johnsshelfer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> But to run a migration "rake db:migrate" is right command ,still > it didn''t run .why?That''s what error messages tell you. But you have to read them. -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org http://about.me/hassanschroeder twitter: @hassan -- 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 rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Mon, May 23, 2011 at 11:32 PM, Hassan Schroeder < hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Mon, May 23, 2011 at 8:17 PM, John shelfer <johnsshelfer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > But to run a migration "rake db:migrate" is right command ,still > > it didn''t run .why? > > That''s what error messages tell you. But you have to read them. >> I checked out this and it seems ok with my migration coding part > > http://guides.rubyonrails.org/migrations.html >-- 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 rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Tue, May 24, 2011 at 1:58 AM, john shelfer <johnsshelfer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:> > > On Mon, May 23, 2011 at 11:32 PM, Hassan Schroeder < > hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> On Mon, May 23, 2011 at 8:17 PM, John shelfer <johnsshelfer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> wrote: >> >> > But to run a migration "rake db:migrate" is right command ,still >> > it didn''t run .why? >> >> That''s what error messages tell you. But you have to read them. >> > > >> Problem is solved. >> >-- 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 rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.