Displaying 20 results from an estimated 2000 matches similar to: "variables in layouts"
2006 Jan 07
8
exposing id''d
I have been working on a small app that started with some scaffolding.
Some of my actions still have the structure where the id''s of things are
passed on the url for gets.
Whats the best way to avoid the security problems that this creates?
I am sure that there are many pages written on this topic but I guess I
have been searching for the wrong things.
Thanks
Gareth
--
Posted via
2006 Mar 16
9
Baffling AJAX issue
Ok, I''ve got some link_to_remote stuff working elsewhere just fine, but
this time it''s doing something very screwy. Here''s the view code to
create a link to remotely toggle a boolean value on a record:
<td class="contact_active">
<%= link_to_remote "<div id=''contact_active_#{cm.id}''><span
2006 Mar 03
5
Quick question about @params
I was looking through the loginGenerator code and noticed the following:
Login:
User.authenticate(@params[:user_login], @params[:user_password])
Signup
User.authenticate(@user.login, @params[:user][:password])
The syntax of the call in the signup code confused me...what exactly
does @params[:user][:password] this return to me? Is the params
structure a multi-dimensional array? I would have
2006 Mar 03
3
Switchtower not updating code...
When I deploy using switchtower the code does not update at all. It
does however copy the old release into its timestamped directory under
/releases/, but nothing in /currect/... is updated.
Any help at all would be much appreciated!
--
Posted via http://www.ruby-forum.com/.
2006 Apr 12
1
Back In Time
On a system that I am working on, there are 2 places where you can edit
answers to questions. After editing, I need to redirect back to the
place where the user came from. A common problem I am sure, but I
couldn''t find any info on how other people had handled it.
I came up with a method called ''redirect_back_in_time'' that redirects
you to a point in history.
I
2006 Mar 16
1
application_helper.rb vs application.rb
I find that I want to put the same methods into both of these files.
Whats the best way to get away with a single implemenation?
Gareth
--
Posted via http://www.ruby-forum.com/.
2006 Apr 25
2
Bug in Rails 1.1 implementation of before_filters
I just spent a few hours tracking down a bug in Rails 1.1, so I thought
I''d post the issue and a workaround just in case anyone else hits it.
I designed a security enhancement so that controller methods can be
protected by preceding them with a role. The standard Ruby
method_added() callback is used to detect when controller methods are
added, and then I manipulate the
2013 Jul 23
1
Postgres adapter misconfigured on Linux?
I''ve written a simple Rails migration that adds an index to an existing
Postgres table:
class AddIndexToEvents < ActiveRecord::Migration
> def change
> add_index :sf_events, :account_id
> end
> end
However, when I run the migration, it fails due to a syntax error on the
CREATE INDEX line. I''m expecting some SQL like this to be generated:
CREATE INDEX
2006 May 23
11
adding layouts within layouts
Hi,
I want to be able to have several layouts within each other so that I don''t
have to keep repeating the layout code for one, in another. An example
would be having a layout for the title of your web page and then having an
embedded layout for the body portion in which the HTML for whatever view
gets displayed. Is this possible?
Thanks.
-------------- next part --------------
An
2006 Mar 23
1
can befor_filter expect other controller''s action?
i put
befor_filter :setup_user,:except=>:login
in ApplicationController.rb
but i want to put action login to other controller
how can i do it?
does rails has this support?
befor_filter
:setup_user,:except=>{{controller=>''user'',action=>''login''},...}
--
Posted via http://www.ruby-forum.com/.
2005 Dec 30
6
call a method once per page request
Hi,
I''m wondering if there is a simple solution to call a method once per
page request.
I tried to place my call in a before_filter in ApplicationController but
it''d called a second time if I use render_component from a view.
Seems to me that a hook should be added in Dispatcher#prepare_application.
Context: working on i18n, I''m trying to check lang either from uri,
2006 Mar 28
1
simple output string
Hi!
I am new to Rails and wanted to know how I can print an easy
string-line.
I wanted to generate a dynamic title for my blog articles made with
"typo":
The first part of the html-title stays the same:
<title>softrockcookie</title>
if it is not the mainpage ("softrockcookie") it shall add the
page_title, so:
<title>softrockcookie <%= page_title
2003 Jan 14
1
0.99.7 out
This one seems to be actually working. Also rewrote doc/index.txt in
case someone is interested.
2008 Jun 02
1
Looking for help on two issues with Rails 2.1 and RSpec 1.14
I have specs that ran fine in Rails 2.02/RSpec 1.13 that are failing on
Rails 2.1/RSpec 1.14.
There is one problem and one issue:
problem: sometimes (but not always) I get a NoMethodError referencing a
has_many association
issue: in helper specs, instance variables don''t get set unless the
HelperModule is included. Using the preferred helper.<method> I can''t seem
to
2006 Jun 14
3
where to define a struct
Hello,
I''m trying to use the following Struct in my web app:
UserInfo = Struct.new( "UserInfo", :first_name, :last_name, :email,
:domain_name )
I placed this in the environment.rb, thinking that it should be
initialized only once.
But when I try to access it from within my controller, I get:
undefined method `UserInfo'' for #<UserController:0x243ad5c>.
so
2011 Sep 04
4
same html elements rendering twice on page
hey all,
My index.html.haml:
- wrap do
- page_title "Teams List View"
application_helper.rb:
def page_title(title)
content_tag :h1, title
end
def wrap(&block)
concat(content_tag(:div, capture(&block), :class =>
"generic_header"))
end
I load in browser and get:
<div class="generic_header"><h1>Teams List
2006 Apr 27
7
HTML Title
Hi there,
If I have an application.rhtml template what''s the best way to set
the contents of title element in the html -> head area of the
template to something set in the view for action in a controller. I
want to just have one template which renders the basic layout for all
pages and I''ve been scratching my head over this one for a couple of
hours now.
Any help
2006 Jan 14
4
hide_action doesnot hide view
The view file (eg. apps/views/items/list.rhrml) is still displayed even
when the action is hidden (hide_action :list). How can I hide view file
form being automatically displayed in this circumstance?
thanks,
jigar
--
Posted via http://www.ruby-forum.com/.
2002 Nov 24
2
vpopmail support?
Well, I read that back in 0.98 or so vpopmail support should work so I assumed it would be enabled in 0.99 but here's what I get.
gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../../src/lib -I/usr/local/vpopmail/include -g -O2 -Wall -W -g -O2 -Wall -W -c userinfo-vpopmail.c
In file included from userinfo-vpopmail.c:12:
/usr/local/vpopmail/include/vpopmail.h:133: syntax error before `*'
***
2009 May 25
1
Help --- My phone number field saves blank
I have a phone field in my table.
But in my form i have two text boxes to get the phone number and the
country code like below
Enter country code ----- Enter phone code ------
In my table i have to save the phone code field after joining the above
values with "-" symbol.
Example => 0225-25874255
I dont have table field for country_code .
So i created like below
attr_accessor