Displaying 20 results from an estimated 700 matches similar to: "Multiple Layouts - Single Controller"
2006 Jul 25
6
DRY question (newbie)
Say i want to include the same chunck of text (a menu on a webpage for
example) on each page. Is there a method by which I can save the HTML in
a text file and call it up later? Is there a better way?
I know ruby has "puts" but i can''t use that b/c it does not work with my
webhost (dreamhost.com)
Any suggestions?
--
Posted via http://www.ruby-forum.com/.
2006 Jul 14
9
DRY Javascript Degredation
Hi,
It seems there must be a better way to do this than what I am
currently doing.
I have a simple app that collects a users thoughts along with their
email address and their first an last name. On a page that lists all
the users thoughts they can click on a link to "add a thought" which
then displays a form with ajax. My current methodology for this is
not very dry. If js is
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 Apr 19
9
Initial load time when periodically_call_remote
When I do periodically_call_remote with e.g. :frequency => 30
after initial page load I have to wait 30 seconds until this partial
renders first time. Does anybody know how to make ROR to render partial
on web page load, and then start periodic calls every 30 seconds? I
tried to put
<div id=''mydiv''><%= render(:partial, :action=>''myaction'')
2006 Jul 14
5
Ideas for AJAX pagination
Hi,
I am looking for ideas on how to remove the last item from a
paginated page when a new item is inserted, thus leaving only 10
elements on the page.
Currently I have a form that inserts with AJAX, but as expected, each
post added to the page just increases the number of posts leaving 11
on a page that should only be displaying 10.
I have unique ID''s for each post (e.g.
2006 Apr 26
2
freezing to Rails 1.0 for a production site
Hi,
I have a shared web hosting account. Currently the hosting company has
Rails 1.0 but I''m sure they will upgrade to Rails 1.1 sometime soon. I
don''t want my site to break if anything with Rails 1.1 will cause a
break. How do I freeze my app to Rails 1.0? I imagine I download the
rails source into the vendor directory. But from where to download and
how to configure my app to
2005 Mar 02
2
form action in mail (actionmailer)
Hi everyone. : )
I meet problem when use form tag in actionmailer. (content-type is text/html, surely)
I want to use form action in actionmailer''s view (.rhtml) for some reason.
1. I use start_form_tag helper method as normally, but how I can ?
I did <%= start_form_tag :action => "http://myhostname/mycontroller/myaction" %> or
<%= start_form_tag :action =>
2005 Dec 21
3
Lazy Loading?
I''m having problems with what seems to be lazy loading behavior in Ruby
on Rails. I have two objects in a parent-child relationship such as:
class Order < ActiveRecord::Base
has_many :items, :dependent => true
end
class Item < ActiveRecord::Base
belongs_to :order
end
I put an instance of the Order object into the session using:
session[:order] = Order.new
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'',
2008 Jun 17
4
Formating Date Field
First.jsp
------------------
<jsp:usebean id="db" class="db.dbClass" scope=session/>
<html>
<body>
<form action="MyAction.jsp" method="post">
<% ResultSet rs=db.executeQuery("select no,name from mytable");
while(rs.next())
{%>
<input type=checkbox value=<%=rs.getString(1)%> onclick=callJs(<
2006 Apr 20
8
2 layouts per .rb page
Hi,
Is this possible
ive got layout "loggedout_layout", :only => [:login, :logout]
but I also want to do somthing like
layout "loggedin_layout", :except => [:login, :logout]
When the second one is introduced it seems to cancel out the first
request, any suggestions how to get around this?
Scott
--
Posted via http://www.ruby-forum.com/.
2014 Jun 13
1
Need to spoof the callerid using the AMI Originate
We have several customers we need to place outbound calls for (in a single system). May have to place calls for thousands of different caller ids. Customer signs a contract guaranteeing the caller id they provide is owned by them.
I have everything setup for AMI Originate and can place the calls.
However, I'm encountering a problem with the caller id.
The system I'm dialing through
2006 Jun 27
2
Using a different layout/styleshheet
Hi,
I have a view that I use to display and capture data. Once the user
has input the required data, I then need to be able to print the view.
I know that I can setup a stylesheet to take care of the page layout
but it is not clear to me how I will make the print view call the new
layout.
If anyone could clarify this or point met in the right direction, I
would be most grateful.
Regards,
Paul
2006 Apr 15
2
Using a Button to render partial
Is there a way to render a partial using a button? Basically in a
content div I want the user to launch a new sub content item in the same
div by clicking a button.
Any help appreciated.
Loving rails more and more everyday.
--
Posted via http://www.ruby-forum.com/.
2006 Dec 28
0
Localization using inheritance
Hi!
I''m trying to implement localization using inheritance, i.e.:
class ParentController < ApplicationController
layout "mylayout"
def initialize
#do something
end
def index
#do something
end
def search
#do something
end
# ...
end
Controller do his job and render page using "mylayout" and views from
"/view/parent"
2006 Jul 21
3
[Slightly OT] CSS with wildcard?
Sorry if this is a simple question, I''m a CSS noob.
I have a rails app that is displaying posts, I am having it generate
each post with its own div like "post_19", "post_20", etc.
I could make it so it puts another div around that div (i need the
individual post div''s for deletion with AJAX) but would rather not.
Is there some way to use CSS to do
2005 Dec 11
1
Quantile function for the generalized beta distribution of the 2nd kind
I have succeded in defining the cdf of the generalized
beta of the second kind, eg.
pgbeta2 <- function(quint,b,a,p1,p2) {
integrate(function(x)
{exp(log(a)+(a*p1-1)*log(x)-(a*p1)*log(b)-log(beta(p1,p2))-(p1+p2)*log(1+(x/b)^a))},0,quint)$value
}
but I'm facing problems with the quantile function. I
tried something like
qgbeta2 <- function(proba,b,a,p1,p2) {
optimize(function(z)
2017 Mar 13
2
modbus driver for phoenix contact industrial UPS
Hello,
this is to let you know I will start working on a modbus driver for the
PhoenixContact QUINT-UPS industrial DC UPS, model 2320461.
https://www.phoenixcontact.com/online/portal/us?uri=pxc-oc-itemdetail:pid=2320461&library=usen&pcck=P-22-07-01-01&tab=1
I will reuse some parts of the nutdrv-modbus branch, but this will be a
model specific driver, not a generic one. Unfortunately
2006 Mar 08
7
Function could determine the caller action ?
Is it possible to determine which action call the function ?
In example, func_test in ApplicationController could determine which
action from SiteController is calling her ?
in class ApplicationController I have
def func_test
if ( calling from index )
return "1" end
if ( calling from contact )
return "2" end
end
and in class SiteController
def
2006 May 03
3
Graceful degrading AJAX show/hide
Ok i''ve done a bit of hunting around and I can''t find much
documentation on how ensure an ajax call through an rjs file degrades
with javascript off.
Essentially, if javascript is off, I want to refresh the page and pass
a variable from the controller to the page the user is on. Not use the
rjs file.
At the moment i have this:
<%= link_to_remote("Advanced Search",