partial

1 view
Skip to first unread message

Marcos Vinicius Schwaab

unread,
Nov 13, 2009, 12:03:29 PM11/13/09
to rails-br
Boa tarde pessoal!

routes.rb

map.namespace :admin do |admin|
admin.resources :comments
end

tenho um admin como fica a rota para eu carregar a partial que está
nas pastas

admin/comments/_comment.html.erb


<%= render :partial => @order.comments %>
<% remote_form_for [@order, Comment.new] do |f| %>

assim ele renderiza mas comments/ eu precizo puxar (admin/comments/)
e a NEW tb.













<div id="coments">
<h2>Comentários:</h2>
<%= render :partial => @order.comments %>
</div>


<% remote_form_for [@order, Comment.new] do |f| %>
<p>
<%= f.label :post, "Novo Post" %><br />
<%= f.text_area :post %>
</p>
<p><%= f.submit "Enviar"%></p>
<% end %>

Marcos Vinicius Schwaab

unread,
Nov 15, 2009, 7:03:47 PM11/15/09
to rails-br
quando eu dou um RAKE ROUTES

da o erro


RAKE ABORTED!

wrong number of argumens (2 for 1)

(see full trace by running task with --trace)

Marcio Aun Migueis

unread,
Nov 15, 2009, 7:11:08 PM11/15/09
to rail...@googlegroups.com
Põe o route.rb pra vermos .... Deve ter alguma coisa errada nele.

Em 15/11/09, Marcos Vinicius Schwaab<marcos....@gmail.com> escreveu:

Marcos Vinicius Schwaab

unread,
Nov 15, 2009, 7:15:10 PM11/15/09
to rails-br
ActionController::Routing::Routes.draw do |map|

map.resources :comments
map.resources :stats
map.resources :tecnics

map.resources :orders, :has_many => :comments
map.root :controller => "orders"


map.namespace :frontend do |frontend|
frontend.resources :ordems
frontend.resources :tecnics
frontend.resources :comments
end

map.with_options :controller => 'info' do |info|
info.faq 'faq', :action =>'faq'
info.search 'search', :action =>'search'
info.list 'list', :action =>'list'
info.desc 'desc', :action =>'desc'
end

map.connect ':controller/:action/:id'
map.connect ':controller/:action/:id.:format'
end

Marcos Vinicius Schwaab

unread,
Nov 15, 2009, 7:16:45 PM11/15/09
to rails-br
ops errei ali no colar!

>   map.namespace :frontend do |frontend|
>     frontend.resources :orders
Reply all
Reply to author
Forward
0 new messages