Displaying 20 results from an estimated 10000 matches similar to: "1 controller, 2 layouts"
2010 Apr 29
2
send_data => invalid byte sequence in US-ASCII
I''m trying to display a generated .png plot via send_data(), but it
results in a server error "invalid byte sequence in US-ASCII" error.
I''m pretty sure this means that I need to specify the encoding
somewhere, but I haven''t been able to figure out where or how to do so.
Some particulars:
I''m running gnuplot through a pipe to generate a plot in .png
2005 Dec 15
5
Avery Lables, PDF::Writer or LaTex?
In a new app we are developing, we need to be able to dynamically create
a PDF and send it to the browser (inline with send_data). I have been
tinkering with PDF::Writer and love the simplicity and native ruby-ness
of it all.
However, one of the main uses for this functionality is to output a PDF
of addresses to be printed on Avery 5161 labels. LaTex seems to be
suited well for this, but it
2006 Jul 21
7
Layouts
I am trying to set the layout for certain actions within a controller,
but not others, but doing
class JoinController < ApplicationController
layout ''form''
def index
end
def add
end
end
sets layouts for all actions, and doing
class JoinController < ApplicationController
def index
layout ''form''
end
def add
end
end
returns an
2006 Apr 04
6
Replaced Rails Package with HiveLogic Install - problems
Hi,
I''ve got a strange problem. I had initially installed Rails using Tony
Arnold''s package:
<http://www.tonyarnold.com/articles/category/rails>
and that worked fine. (on OS X, obviously). I then decided to
reinstall using the instructions on the HiveLogic page, to get Ruby
1.8.4:
<http://hivelogic.com/articles/2005/12/01/ruby_rails_lighttpd_mysql_tiger>
That
2006 Jan 19
2
date_select broken
I am using date_select and in some instances it only shows about 10
years worth of choices. Same form on other users shows the whole
range. date_select looks like this
<%= date_select ''user'',''birthdate'' , :start_year => 1940 %>
I would expect to always see 1940-2006 or so , but i dont always do.
Is there a way to force the range or explain why i
2006 Mar 10
3
In Place Editor and Empty Fields
So, the InPlaceEditor with AJAX is all nice and dandy, works great.
What about fields that don''t have any content? As far as I can tell, this
doesn''t work so well - there''s nothing to click on so no edit form pops
up...
Am I missing something?
HH
2006 Aug 09
2
layouts, stupid problem :P
hi! how can i put different layouts for the actions in the same
controller?
i was putting the layout always at the beginning of the controller, and
i tought, if i put a layout in an action, it would be work, but nop.
i mean:
UserAdminController < ApplicationController
layout ''admin''
...
def edit
layout ''edit_2''
...
end
end
how can i resolve my
2006 Jul 06
6
Class variables in templates/layouts
I''m having problems with class variables.. I have a class:
class Content::ApplicantsController < ApplicationController
layout "mylayout"
@@tab = "mystring"
[... the rest is standard scaffold-created stuff ...]
and a layout (mylayout.rhtml):
[...]
<title><%= @@tab.capitalize %></title>
[...]
And I keep getting this error:
uninitialized
2006 Jun 19
1
pdf simpletable help needed
i am trying to generate a pdf of all of the users in an application that
i have built. i am still pretty new to ruby and rails so i don''t know
the best way to go about it.
here is my controller code:
require ''pdf/writer''
require ''pdf/simpletable''
class ReportsController < ApplicationController
def test
_pdf = PDF::Writer.new
table =
2011 Aug 28
3
rspec-rails render_views doesn't render layouts? / how to check flash isn't rendered
I''m trying to test that "static" pages (they''re ERB, but get cached),
generated through rails, don''t render any stray flash notices left over by
the authentication system (Devise) or wherever else.
I''ve tried writing this controller spec, but it appears that response.body
only renders the template, not its layouts?
describe "so that static
2006 Jul 29
4
good css based website layouts for download???
Just wondering if anyone knows of a site where one could review a number
of website layouts (which use CSS concepts) where you could then select
the one you want and then just download the template HTML and CSS to
import directly in your application.
i.e. Gives you a decent overall look and feel straight away and then you
can concentrate on your actually dynamic application aspects.
Cheers
2006 Jan 03
3
Engine and controller layout confusion
Hi all,
Installed the login_engine which is working. But I''m confused as to how I tell
Rails to use the "/app/views/layout" rhtml files, when partials from the
login_engine are used from "/vendor/plugins/login_engine/app/views/user".
Do I copy login.rhtml to /app/view/mgmt?
(mgmt is a controller name in my app)
Along the same line:
I also have a nil error on the
2006 Apr 01
5
What IDE for Rails on OSX?
Hi,
I''m using TextMate for rails development on OSX, but have reached a point
where I need to run in a debugger and be able to step through the code as it
executes. I have previously used the Eclipse Ruby plug in and another IDE
for ruby development on windows, but never figured out how to run a Rails
app in the debugger.
How are other textmate users debugging and what else is there on
2006 Jan 04
7
variables in layouts
I have a layout that provides the basic outline of each page in my app.
It has a title, footer and a navigation bar.
In the title I want to put the name of the current user that is logged
in.
I could do something like @session[:username] but I would rather
encapsulate that into a single variable so that I can change the key in
the session map if I want without having to goto each page that
2006 Jan 23
2
UserEngine -- Permission.synchronize_with_controllers -- trouble with my own controller modules
I suspect there''s an easier version of this question that I could ask,
but I''m not sure where I''m going wrong. I have LoginEngine and
UserEngine setup and seemingly running fine. However, not all of my
controllers are being found when I run "rake sync_permissions".
Specifically, it''s the controllers that are not in the base
controllers folder, but
2006 Feb 21
4
customizing layouts for functions
I want to be able to have different layouts in my rails program for
different functions.
For example, when a person first comes to the site the layout will have
a link that says ''home'', ''login'', or register on the menu bar.
Once the user logs in however, the layout will change. I want it to show
the links ''account manager'',
2006 Feb 02
4
How switching global layout (application.rthml <or> custom.rhtml)
Dears,
My railsapp run using ''/layout/application.rhtml'' and under some
conditions ( Authenticated user, url parameter) I like to switch
globally to another layout, let''s say custom.rhtml
Like :
class AppController < ApplicationController
before_filter :context_layout
def index
end
end
# application.rb
def context_layout
if <context_condition>
2007 Dec 06
10
Feedback on RC2
I tried to upgrade my existing application to RC2 last night. Like many, I
use this mostly for running scheduled tasks. For the moment, I''ve abandoned
the effort, but am looking forward to being able to use this. Feedback
below:
First, the reason I was looking forward to this upgrade was to use the
threaded scheduler. I have an application with long-running tasks. I found
that
2008 Apr 29
1
Spec''ing controller macros
Hi,
(This is my first post after months of appreciative lurking...)
I''m trying to spec the following conditional controller macro:
class ApplicationController < ActionController::Base
# turn off session management for robots
session :off, :if => lambda {|req| req.user_agent =~ /(Google|Slurp)/i }
# ...
end
My current attempt seems to be quite unsuccessful:
1) when I
2006 Apr 03
1
Best way to set custom Controller options
Hi All!
I''m searching a good way to set some options in my Controllers; I tried
defining a custom function, ie:
class PeopleController < ApplicationController
set_my_actions :action1, :action2
end
class ApplicationController
def self.set_my_actions(*args)
@@my_actions = args
end
end
But ''@@my_actions'' sets the class variable to _every_