Displaying 20 results from an estimated 1600 matches similar to: "Using the :layout option when calling render @variable"
2007 Sep 29
1
templates with same name before extension are cached
Hi all,
I was just wondering if this is the intended behavior. Here is my setup:
controller
def index
respond_to do |f|
f.xml { render :xml => true }
f.html { render :layout => :none }
end
end
In my views I have a file for each type
index.herb
index.xerb
The first request I send is cached and interferes with the other one.
For example, if I send an xml request
2011 Apr 06
1
Time to fix PartialRenderer#partial_path
For the longest time PartialRenderer#partial_path has prefixed the
prefix of the current controller when it is nested in a module. This
hasn''t been a problem (because nesting controllers wasn''t that common)
but with 3.1 striving for better engine support, this problem is now
larger because all of your controllers for an engine will be nested
and it makes doing <%= render
2013 Mar 24
5
Rails 4.0 has_many_through and fields_for
Hi all, I am trying to reproduce rails 3.2 behaviour with fields_for and
nested attributes.
class ControllerAction < ActiveRecord::Base
has_many :interactions, dependent: :destroy
has_many :roles, through: :interactions
scope :controllers, lambda {|name| where("controller_name_id = ?",
name)}
scope :actions, lambda {|name| where("action_name_id =
2012 Nov 26
5
Missing template pages/layout only occasionally
I have my app email me errors when they occur. I get this about 2-3
times a week with thousands of hits a day to the site. pages/show is a
.html.erb file that renders the partial
_strategicrelationshipacademy.html.erb essentially. Or whatever partial
it calls for. I get this on many different ''pages''. Obviously the
partial exists if it renders it fine most of the time. What
2012 Sep 11
4
Should i buy Ruby on Rails 3 Essential Training with Kevin Skoglund from Lynda.com
hello people, i m new to rails and i m thinking of buying Ruby on Rails 3
Essential Training with Kevin Skoglund tutorial
http://www.lynda.com/Ruby-on-Rails-3-tutorials/essential-training/55960-2.html
but problem is the tutorial is created on 2010 oct => so its 2 yrs old
so my question it is fine to Buy these Tutorial in the changing rails world?
Please Help me
--
You received this
2012 Sep 25
9
Any rails experts able to offer some advice?
Hello all.
#1 I am working on a rails3 gem called Yarder
(https://github.com/rurounijones/yarder). The goal of this gem is to
replace the rails logging system with one that is JSON based rather than
string based.
#2 To this end I also recently asked this list about making the
LogSubscribers subscriptions to ActiveRecord::Notifications configurable
and am looking at submitting a patch
2012 Aug 16
1
[error] rake db:create
i try run this command
but appear this error someone can help me?
see the error: http://paste.ideaslabs.com/show/IFSSXASQyM
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/XRxX9RXunsYJ.
To post to this group, send email to
2013 Jan 23
2
Problem with Bootstrap-SASS
I''ve installed bootstrap-sass, and added an @import line in my css. Rails
won''t find or serve up the bootstrap files. One error msg on the Mozilla
console says:
The stylesheet http://localhost:3000/assets/bootstrap was not loaded
because its MIME type, "application/javascript", is not "text/css".
Hmm. If I change the @import to say
2013 Mar 28
1
undefined method 'sanitize_limit' for #<ActiveRecord::Relation:0x2aaaad35d720>
I am trying to upgrate rails from 3.0 to 3.1, while updating rails version
I am getting following error
rake aborted!
undefined method `sanitize_limit'' for
#<ActiveRecord::Relation:0x2aaaad35d720>
/some_package/lib/ruby/gems/1.8/gems/activerecord-3.1.12/lib/active_record/relation.rb:460:in
`method_missing''
2011 Feb 21
2
self.prepend_view_path - am I missing something
I have an app that varies its content based upon the domain from which
it is being accessed. Some of the domain characteristics are
supported in the model but it is easier varying static text in the
views and then sharing the form templates via partials etc.
Rails 2.3.10 and looking at the documentation at
2010 May 06
0
Problems using exception_notification 2.3.3.0
Hi.
I am using rails 2.3.5
I just installed exception_notification 2.3.3.0 using ''sudo gem install
exception_notification''
I have add config.gem "exception_notification" in environment.rb and
''include ExceptionNotification::Notifiable'' in application_controller.rb
Now I am trying it out in development environment.
It seems to catch my exception
2013 Jan 25
9
Object#tap_if and Object#tap_unless
I originally brought this up in: https://github.com/rails/rails/issues/9067
Rails paved the way for Object#tap and Object#try...I''d like to propose
Object#tap_if and its counterpart,Object#tap_unless.
I''ve been following 37signals conventions of tapping variables in the views:
<% account.owner.tap do |user| %>
...
<% end %>
But, I find myself having to do this
2006 May 18
3
Render layout on the fly
Hi guys,
i was wondering if there is any possibility to render a layout on the
fly instead of putting it into the layouts/ folder. Any ideas?
--
Posted via http://www.ruby-forum.com/.
2005 Dec 20
0
error when I use render(:layout=>false)
I have a simple controller action, which works just well with the
layout. Once I introduce render(:layout=>false) - the view does not seem
to be "linked" the the controller''s @ vars, which are nil!
how weried is that? what am I doing wrong?
--
Posted via http://www.ruby-forum.com/.
2013 Nov 19
0
specifying partial layout with a block to render
<%= render collection do %>
<li><%= yield %></li>
<% end %>
there are many cases when you wouldn''t want to create layout files
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
2010 Oct 27
0
"Missing partial layouts/application" error on render :partial => "index", :layout => "application" - Rails3
This is the second time I have seen this error, and been googling around and
cant find an explanation. This error is happening with Rails 3/1.9.2 and was
not with Rails 2.3.8/1.8.7:
*Template is missing
Missing partial layouts/application with {:handlers=>[:erb, :rjs, :builder,
:rhtml, :rxml], :formats=>[:html], :locale=>[:en, :en]} in view paths
2007 Jul 28
2
specing a call to render :layout => "some_layout"
I''m trying to specify that an action should be rendered with a given layout
one particular spec.
What I''ve got at the moment is this.
it "should render with the grabber layout" do
controller.should_receive( :render ).with( :layout => "my_layout" )
do_get
end
This doesnt work even though this call to render is being executed.
render :layout
2006 May 17
9
Render No Layout?
Hi guys,
Am having a problem.
I have this def in my index controller that works like this:
def do_something
$a = variable1
$b = variable2
$c = variable3
$d = ""<script language=\"Javascript\"> \n new Insertion.Bottom(''#{$c}'',
''#{$a} - #{$b}''); \n </script>"
$trigger = "1"
render(:partial =>
2006 Jan 23
5
Variable Scoping Problem
I am having some problems with variable scoping.
I need to be able to set a variable that is accessable by other methods
within the class (or instance) (i.e not global).
An example is 2 pages that change a class variable:
class AjtestController < ApplicationController
def initialize
@@variable = "init"
end
def show
@display = @@variable
@@variable = "change 1"
2009 Jun 06
2
How does controller call render when there's no render in action
Hello,
I was studying Rails source and at this point:
def process(request, response, method = :perform_action, *arguments)
#:nodoc:
response.request = request
initialize_template_class(response)
assign_shortcuts(request, response)
initialize_current_url
assign_names
log_processing
send(method, *arguments)
send_response
I have a