Displaying 20 results from an estimated 800 matches similar to: "2 layouts per .rb page"
2006 Apr 20
4
css
Hi im using this code below
layout "loggedout_layout", :only => :login, :logout
this part limits it to logout only, how can I get it to limit it to
logout and login?
Thanks
Scott
--
Posted via http://www.ruby-forum.com/.
2006 Jul 18
4
Multiple Layouts - Single Controller
How do I do multiple layouts for a single controller:
I am aware I can do... render(:layout =>''mylayout'') for individual
actions, however this becomes a multiple render problem.
I tried this...
layout "mylayout", :except => [:myaction, :myotheraction]
layout "myotherlayout", :only => [:myaction, :myotheraction]
However that doesn''t
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>
2006 May 06
5
login generator always give login unsuccessfull
hi guys,
i just did what it is written in this website to genrate login
http://wiki.rubyonrails.org/rails/pages/HowToQuicklyDoAuthenticationWithLoginGenerator
at the end i add to the database login and password
but when i tried to login it give me login unsuccessfull
can anyone help me
thanks
notice: i m beginner in webdeveloppement and especially ruby on rails
--
Posted via
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
2007 Jan 19
9
werid error, please help
Hi all,
I updated to Rails 1.2.1. However, when I tried to access the URL
http://localhost:3000/
i get this Application Error
Change this error message for exceptions thrown outside of an action
(like in Dispatcher setups or broken Ruby code) in public/500.html
I removed the default index.html and route it to Account controller.
If you read the log below, it seems that the AccountController is
2007 Oct 16
6
Failure trying to test ApplicationController
I''m trying to write some tests for the ApplicationController as shared
tests that can be run in all of my other controller tests, but am getting
a nil.rewrite error. Below is what I have...
describe AccountController do
it_should_behave_like ''Application controller''
end
describe ''Application controller'', :shared => true do
it
2010 Sep 06
5
how to call rails method from javascript method.
hi
I wanna call rails method from the javascript method.
It should be ajax call for rails method.
please help me.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe
2006 Aug 12
6
params not getting POSTed
I have a situation where no params are being sent when the form is
submitted.
After the rendering this is the html that I get...
<form action="/stats/new" method="post">
Height: <input id="stat_height_ft" name="stat[height_ft]" size="5"
type="text" />ft </p>
Weight: <input id="stat_weight_lbs"
2008 Feb 24
3
1 error(s) on assignment of multiparameter attributes
I am trying to create a form for processing credit cards. For the
credit card expiration date, I would like to leave the day field out
of the form for obvious reasons. However, the following code is
producing an error for me.
Any ideas?
Thanks!
<p><label for="email">Expiration</label><br/>
<input type="hidden" id="user_card_expiration_3i"
2007 Jan 25
4
How to change the menu depending on the controller/method?
Hello,
I''m still dtarting with ruby on rails. And I''m trying to have a menu
depending on the current controller/method.
Here is what I was thinking of (please tell me if there''s a better way
to do it):
I have a database with menu_groups (corresponding to controllers) and
menu_elements(corresponding to methods). Each menu_element belongs to
one menu_group.
I created a
2007 Sep 16
5
"rake spec:doc" returns NO NAME (due to --dry-run) for each specify block
I went ahead and moved to the trunk versions of RSpec and Spec:Rails because
I wanted to try out the new Story Runner feature. However, when I tried to
do "rake spec:doc", I got the following:
AccountController
- NO NAME (Because of --dry-run)
AccountHelper
- NO NAME (Because of --dry-run)
User (in general)
- NO NAME (Because of --dry-run)
- NO NAME (Because of --dry-run)
- NO NAME
2006 Mar 27
3
Specify a controller action via attribute in INPUT tag?
I have a pre-existing form with one existing "SUBMIT" tag generated by
<%= submit_tag %>
I would like to add another <INPUT type="submit" ...> to my form.
How do I successfully associate that <INPUT> tag with a different
controller action than the default one specified by my <%=
start_form_tag %>?
Or does this approach even make sense?
In RoR, is
2009 Jun 07
6
Missing Template when testing with the Brain Buster Captcha partial
When I run my functional tests, they throw an error with the following
message:
ActionView::TemplateError: Missing template /_captcha.erb in view path
app/views:test/vendor/plugins/brain_buster/views/brain_busters
On line #23 of app/views/contacts/_form.html.erb
20: <%= f.label :message %><br />
21: <%= f.text_area :message %>
22:
2006 Jun 30
5
If / Else Form layout question.
Hello all,
I''m using the following _form.rhtml layout for a number of pages,
including edit record and new record (which each has it''s own definition
in the controller).
I''d like to display a different author form field depending on which
page they are using. I''d rather keep using _form.rhtml as a layout
template, instead of customizing each separate page.
2006 Aug 01
8
Decoupled observers for controllers?
In the Rails Recipes book the recipe "Keeping track of who did what"
explains how to do decoupled observing of models.
In my application I''d like to do a similar thing but watching the
controllers. For example, when somebody hits the login method of the
Security controller, I''d like to make a note of it. In this case I
could observe the User model and watch for
2006 May 23
3
image_tag problem
Hiall,
I want to make an image_tag from within a controller in order to be
able to present a link (with a status image) in a view. Here is my
controller method (in file webca_controller.rb, hence WebcaController)
def untouched_status_image_tag
image_tag("open", { :alt => "Offen", :title => "Offen", :size =>
"12x12", :class =>
2006 Jan 12
4
If statement based on a action
Question for you all is it possible to use an action in an if
statement? I am using the same form for edit and new and I have a
cancel button on the page.
This cancel button is built with an if statement that looks right now
to see if a parameter exists to define where to go back to if the
user cancel. The problem occurs when the user submits the form and
there are missing fields by
2011 Sep 06
8
Ajax and rails 3 UJS (jquery)
Hi, guys,
I''m in the midst of moving an app from rails 2.3.8 to rails 3.0.9.
Sadly, rails 3 no longer has javascript generators and I''m now forced
to do more javascript.
For my project, I have selected jQuery as the javascript framework for
my rails 3.0.9 app.
What I have done to have my app''s deletion link (for each item)
trigger an alert box when the deletion
2006 Apr 27
3
Routing problem
Hi,
I am having a routing problem and can''t figure out why its happing. I
have added the following line in my routing.rb file.
map.connect ''name/:id'', :controller => ''controller_name'', :action =>
''action_name''
When I use http://domain.com/controller_name/action_name/id then it
works fine on the local machine using webrick