Wpis z mikrobloga

#ruby #dev #webdev

Mam wrażenie, że jak środowisko wykopu nie wpuszcza gimbałków, tak środowisko Rails nie wpuszcza pehapowców :P Kurcze, jeszcze jednej linijki nie napisałem a już same błędy :P (Nie wspominając o tym, że czytam tutorial do 2.3 a piszę na 3.2 i muszę się domyślać, co jest nie tak. No ale właśnie.

Utworzyłem aplikację. Hello World działa (jupi). No to dalej:

$script/generate scaffold Post name:string title:string content:text


migracja bazy

routes.rb

resources :posts


root :to => 'home#index'


get "home/index"

efekt:

No route matches {:action=>"show", :controller=>"posts"}


Pomożecie mistrzowie #ror wejść w ten magiczny świat? ;)
  • 43
@kejwmen: to też :)

(in /home/npsr/public*html/blog)


posts GET /posts(.:format) posts#index


POST /posts(.:format) posts#create


new*post GET /posts/new(.:format) posts#new


edit*post GET /posts/:id/edit(.:format) posts#edit


post GET /posts/:id(.:format) posts#show


PUT /posts/:id(.:format) posts#update


DELETE /posts/:id(.:format) posts#destroy


root / home#index


home*index GET /home/index(.:format) home#index
@nvll:

invoke active*record


Another migration is already named create*posts: /home/npsr/public*html/blog/db/migrate/20130627191653*create*posts.rb


npsr@npsr-pc:~/public*html/blog/script$ rails server


=> Booting WEBrick


=> Rails 3.2.13 application starting in development on http://0.0.0.0:3000


=> Call with -d to detach


=> Ctrl-C to shutdown server


[2013-06-27 21:53:38] INFO WEBrick 1.3.1


[2013-06-27 21:53:38] INFO ruby 1.9.3 (2013-05-15) [x86_64-linux]


[2013-06-27 21:53:38] INFO WEBrick::HTTPServer#start: pid=24110 port=3000


Started GET "/" for 127.0.0.1 at 2013-06-27 21:54:01 +0200


Processing by HomeController#index as HTML


Rendered home/index.html.erb within