Displaying 20 results from an estimated 3000 matches similar to: "Accessing the router from a helper"
2008 Jun 15
11
[PATCH] helper to create fb css stylized table
I attached a rails helper implementation of the fb_table described here:
http://wiki.developers.facebook.com/index.php/Facebook_Styles
I included testing and comments. I hope you find it useful.
Curiously, it''s really a small extension of FBML.
Richard
-------------- next part --------------
Index: test/rails_integration_test.rb
2007 Dec 23
1
Rails: possible routing discrepancy
Hey all, I''m seeing a strange behavior in my spec that I can''t
account for. I''ve got a route that looks like this:
map.writing \
''/writing'',
:controller => ''abstracts'', :action => ''index'',
:index => { :select => ''all'' }
and I have template code that looks like this:
<br
2006 Jul 12
3
How to get the current URL?
Hi,
how can I get the current URL withing a controller? There seems to be no
appropriate method in ActionController::Base.
I''m creating a site, which requires a login for some pages. I''m using
before_filter for authentication. My idea was to store the currect URL
in a session before redirecting to the login page and then redirect to
this URL after successful authenfication.
2006 Apr 18
6
Best Practice for Returning to Calling Page?
I have a partial, it''s a shopping cart display, it''s designed to appear
on several different pages of my site.
One of the buttons on the shopping cart empties the cart, and then I
want the calling page to redisplay.
In other words, the cart controller needs to return the visitor to the
same page -- however since the cart could appear on any given page, this
has to be
2010 May 21
8
Designing An Application (UML, Class Diagrams)
Hi
Is there any freeware anybody would recommend for showing database
models and how they relate to each other? I''m picking up an app
another developer left in a mess and I''m trying to sort it out.
Diagrams would be a great help.
Suggestions?
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this
2005 Dec 15
4
Acts_as_tree and routing
I''ve got an acts_as_tree structure which I want to be able to represent
in the URL, with one field identified as the url component. In other
words, if I''ve got this:
def self.up
create_table :nodes do |t|
t.column :parent_id, :integer
t.column :tag, :string
end
end
and
class Node < ActiveRecord::Base
acts_as_tree
end
and what I want the urls to be is something
2010 Dec 25
7
I sit possible to write it in one line ? Array init + Array loading
I am always writing it in 2 lines : ( Array init then loading the
array )
@providers = []
@authentications.map {|authentification| @providers <<
authentification.provider }
Is there any Ruby writing for writing just one line ?
thanks fyh
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group,
2006 Apr 18
4
update_page yields escaped code in callback
Hi All,
The subject pretty well describes what I am experiencing. This line in
an .rhtml template:
<%= link_to_remote menu_item.humanize,
{:update => ''section'',
:url =>{:controller => menu_item},
:complete => update_page do |page|
page.activate_tab("#{menu_item}_tab", ''menu_'')
page[''section''].hide
2010 Feb 23
11
Couldn't find without an ID
Hello all. I''m new to RoR. I am having trouble trying to get a simple
edit/update going. Everytime I hit submit, I get the following error:
+++++++++++++++++++++
Couldn''t find Content without an ID
Request
Parameters:
{"format"=>"#<content:0x4d3daac>",
"commit"=>"Update",
"_method"=>"put",
2011 Apr 06
16
Unable to install Rails using Gem
I am new to Ruby on Rails. I was trying to get Ruby on Rails
installed.
I am on Windows XP with access to internet through a proxy. I
installed Ruby and then Gem. I downloaded both as standalone packages
and unzipped them. But when i tried installing Rails through Gem , I
got the below error
"
C:\Program Files\rubygems-1.7.2>gem install rails --version 3.0.1
ERROR: While executing gem
2008 Jan 30
2
Where can I get "authenticate_with_http_basic"?
Hi,
I just installed Rails 2.0.2
[root@mymachine easyx]# ruby --version
ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-linux]
[root@mymachine easyrx]# gem install rails --include-dependencies
Need to update 16 gems from http://gems.rubyforge.org
................
complete
Successfully installed rails-2.0.2
[root@remandev easyrx]#
But I''m getting this error in my restful_authentication
2010 Dec 30
6
validates_inclusion_of doesn't match constant
Hello, I have a model Model:
SPECIAL_FEATURES = %w(none top)
class Model
validates_inclusion_of :special_feature, :in =>
Model::SPECIAL_FEATURES,
:on => :create, :message => "special_feature
%s is not defined"
belongs_to :team
def special_feature
attributes = attributes_before_type_cast
if attributes["special_feature"]
2010 Oct 31
9
self.where('section = ?', '%:search_item%')
I am trying to do a search where I can enter a part of a word and the
search find all occurrences of that part word in the field. The above
subject does not work. Can anyone help
I am using Rails 3 and ruby 1.9.2
I use to be able to do it in rails 2.x.
In my Model I have the following:-
def self.search(search_item)
if search_item
self.where(''section = ?'',
2009 Sep 10
1
undefined method `protect_against_forgery?'
When I use plugin ''railstree'' (http://www.hashcode.eti.br/?p=91) as
following code:
node = Node.new :label => menu_item.name,
:link_to_remote => {
:base => self,
:update =>
"container",
:url => {
2010 Mar 18
5
One-time script to update 1000s of values in a single column in a table: nil error?
Hi, I have a model called Stock with a value called "strength." I
wrote a simple method in the Stock.rb model file to update the value
of "strength" for each record in the stocks table. I created a
controller called fix_controller.rb. I don''t have access to the live
system, so the idea is that an admin will go to http://url/fix and a
script will run to check and
2010 Apr 19
10
Overview of Ruby 1.9 encoding problem tickets
SUMMARY:
--------
I tried to identify the general and root causes for these problems
with 1.9, by taking into account non-utf encoding, current patches,
comments and ideas. I used ticket #2188 as base for explanations.
This is a long read. I wanted to include all the relevant information
in one place. I also included information about related tickets in LH
and their status. I decided that adding
2006 Jan 07
3
user engine question
I''ve created an array of hashes in UserController#initialize to describe
a menu:
@menu_array = [
{:menu => ''home'', :controller => ''home'', :action => ''send_home''},
{:menu => ''user list'', :action => ''list''},
{:menu => ''login'', :controller =>
2008 Aug 20
4
mod_proxy, mongrel, redirect issue
Hello,
I am configuring apache 2.2 to serve my rails app through mongrel at
the root of my server. First, I redirect all http traffic to https
with the following:
ServerName emiliano
NameVirtualHost *:80
<VirtualHost *:80>
RedirectPermanent / https://emiliano #this server is only accessed internally
</VirtualHost>
Inside the <VirtualHost *:443> section, I have the following
2010 Oct 06
16
Dealing with an EAV database
I''ve inherited an EAV database and there''s really no option to remodel
it. Data is stored as key_name, key_value pairs
Trying to return a meaningful, unified recordset is far too complex to
be efficient.
I''ve decided to make use of the MySQL GROUP_CONCAT, and CONCAT_WS
functions to return a fast query result, with the consolidated fields
as one string.
The final data is
2012 Aug 04
4
Rspec
Hi all i''m trying to learn Rspec testing can anyone suggest me the best
book to learn Rspec with good sample code.
Thanks in advance
--
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 from this group,