Being modular but still interacting

So I want to use components so parts of my code are more modular, and
this maybe a newbie mistake, but it seems to me that if you using
components in a modular way, you can’t redirect or render anything
from your original application. Is this true or am I just overlooking
something?

Here is some code:

class Comments::CommentsController < ActionController::Base
uses_component_template_root

def vote
@comment = Comment.find(params[:id])

comment.rating += params[:rating]

if @comment.save
  redirect_to :controller => '/community', :action => 'show', :id

=> params[:design_id]

end

That redirect will take me to homepage/comments/comments//community/
show/id
but I want it to take me to homepage/community/show/id

Any ideas?

:controller => ‘/community’

should be

:controller => ‘community’

remove the forward slash, and you’ll be fine :wink:

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs