Displaying 20 results from an estimated 500 matches similar to: "Layout not rendered when render_component used"
2006 Apr 13
1
Model is not a class
I''m trying to specify a model in a controller, but rails gives me
"Account is not a class", where Account is my model name ...
This is my model:
class Account < ActiveRecord::Base
validates_presence_of :email, :email_confirmation,
:username, :password, :password_confirmation
validates_format_of :email,
:with =>
2006 Jan 29
1
RJS template problem!
hi all,
i have the following controller:
class UserController < ApplicationController
.
.
.
def login
@user = User.new(params[:user])
@logged_in_user = @user.try_to_login
if @logged_in_user
session[:user_id] = @logged_in_user.id
else
flash[:notice] = "ungültige Daten!"
end
end
.
.
.
end
with this rjs template:
login.rjs:
if @logged_in_user
2006 Dec 01
4
uninitialized constant error in app but not when using console
I''ve got a wierd issue here and maybe someone can assist
i created a module in my apps lib directory which i use for
authenticating against an external source (among other things).
lib/myapp.rb
-----------------
require ''rubygems''
require_gem ''activerecord''
# uses activerecord odbc adapter by openlink
module MyApp
module ExternalSource
class
2009 Apr 29
7
problem with nil.user
Hi all, I''ve put new code into my app so that an administrator will have
extra privileges (administer users, edit pages). The error is:
''Couldn''t find User without an ID''
So the app is looking for a logged in user when the homepage is
accessed.
Heres my code:
site/index view:
<% if is_logged_in? and logged_in_user.has_role?(''Moderator'')
2006 Jul 27
2
setting initial text field values in a form
Hi,
I am trying to create a basic form in which I want one of the fields
initialized before displaying it.
My code (in a view) is as follows:
<%
if ( session[:user_id] != nil )
then
logged_in_user = User.find(session[:user_id])
end
%>
<% form_for :suggestion do |form| %>
<label for="suggestion_title">Topic:</label><br/>
<%=
2009 Jun 05
6
rails 2.3.2
Hi all,
I am using rails v.2.3.2 and if I put following line to my
ApplicationController:
include LoginSystem
and I moved my login_system.rb to lib folder:
module LoginSystem
protected
def is_logged_in?
@logged_in_user = User.find(session[:user]) if session[:user]
end
def logged_in_user
return @logged_in_user if is_logged_in?
end
def logged_in_user=(user)
if
2010 Jul 31
4
Exception: can't dup Symbol
Hey everybody,
I''m trying to test a little piece of code I wrote, and I get the
following error:
Exception: can''t dup Symbol
It happens in the following line: try_to_login @valid_user, :remember_me
=> "1",
where the function try_to_login is:
def try_to_login(user, options = {})
user_hash = {:screen_name => user.screen_name, :password =>
user.password}
2006 Jan 24
1
render_component and private access...
I was wondering if rails had any means of restricting access to an
action in a controller (like they can''t type in url.com/cont/action,
that would throw an error). The thing is I would like to be able to
access this method/action through a call to render_component, so
therefore, I don''t think private methods will work.
So basically I am looking for something that cannot be
2006 Feb 08
1
render_component vs. render_component_as_string?
I''m calling render_component in a helper.
render_component :controller => target_controller, :action => "show", :id => target_id
This works fine, except that passing the id in :params didn''t work and
I had to pass in an explicit :id parameter to get the target
controller to override the id - is that documented anywhere?
That''s not my question. My
2011 Feb 28
1
Problem with render_component and rails 3
I have a application that it use view/layout/application.rhtml, in
this file I have:
<%= render_component :controller => ''car'', :action =>''index''%>
But there is one problem, it display this problem: undefined method
`render_component'' for #<#<Class:0xb67e6e48>:0xb67e5f34>
How can I resolve this problem?
--
You received this
2006 May 26
1
flash.keep not working with render_component
Using Rails 1.1.2 and ruby 1.8.4
I''m having a weird issue with the flash when using render_component for
an action inside different controller than the one from which you
render. I''m passing an object via flash across a couple of actions (new
and create) behind the scenes using flash.keep(:object). It works fine
if the component I''m rendering is in the same
2006 Apr 13
1
Layouts in render_component?
Hi All,
Silly newb question. Is there a reason why :layout is unimplemented
in render_component() ? I''m looking at a situation where that would
*seem* to be the right answer.
Are there any patches available to add this?
JK
2006 Feb 01
1
detecting whether a request comes from render_component
Hi All,
Anyone know if there is a way to detect whether a request came from a
render_component call? There isn''t anything obvious from looking at the
source, but it would be useful as I have set up a logging filter in my
application.rb, and I''d prefer to exclude all component renders, since
they just add extra lines to my log (I guess I could exclude identical
rows at the db
2006 May 07
0
caches_action and render_component
I''ve made some test:
------------------ CODE ------------------
class FooController < ActionController::Base
caches_action :foo
def foo
render_text ''Hello, foo<br />''
end
end
class BarController < ActionController::Base
def bar
render :inline => <<-EOS
Hello, bar <br />
<%= render_component(:controller =>
2006 Mar 14
0
how to render_component in global layout
Hello,
i have one layout file for all controllers. I would like to have news
list on each page. So, i put <%= render_component :controller => "news",
:action => "list" %> , to my layout file. But this doesn''t work at all.
I get error "Application could not be started.. ".
If I put render_component to some view file say
2011 Dec 12
0
<%= render_component %> Tag cloud issue for rails version 2.3.11
hi all,
in my application there is tag''s cloud in old code which is load using
following code
<%= render_component :controller => "controller_name", :action =>
"tag_cloud_homepage"%>
now i upgrade the ruby,gem and rails version to
Ruby :1.8.7
Rails :2.3.11
gem :1.6.2
and i am using Windows XP as O.S
my question, now in Rails 2.3.11 "<%=
2006 Sep 12
2
Cache sweeping and render_component (my mistake or Rails bug?)
Hi
I''m working on a program which relies on heavy cache sweeper usage.
I''ve just bumped onto an odd problem. When using render_component
method in layouts or templates with cache sweeping turned on, Rails
throws an exception with the following message:
NoMethodError in TestController#index
You have a nil object when you didn''t expect it!
The error occured while
2006 Apr 21
1
render_component includes layout
I have dynamically generated list of links that I wish to include in
different views, I''m using render_component to do this but it is also
including the layout.
How do I turn layout off on a per action basis?
Many thanks, K.
--
Posted via http://www.ruby-forum.com/.
2006 Mar 03
0
render_component in application.rhtml
I''m using application.rhtml as the common layout for all controllers in
my app. I want to add navigation links inside the header portion of
each page and this section is in the application layout
(application.rhtml). The navigation links also include inforation like
username and a link to logout if the user is logged in, or link to
login...standard stuff.
Anyway, i have controller
2006 Jul 23
2
How would you do this without using render_component
Hello all.
Am relatively new to RoR and I am pondering how to do something without
using components since they appear to be "coda non grata".
I have a standard layout that is used by all controllers. In this layout
I want to list the next 5 events that are upcoming based on todays date.
These events are currently stored in the Event model (created using
scaffolding). Currently only