Displaying 20 results from an estimated 1000 matches similar to: "Single controller to browse things in categories"
2006 Feb 27
2
submit_tag
How can i use the submit_tag method (from: actionView::FormTagHelper)
to create various submit buttons and chose the right action in accord to
the button that i pushed?
--
Posted via http://www.ruby-forum.com/.
2006 Apr 29
11
Multiple actions from one form - possible?
Hello *
Obviously the rhtml below does not work, but it should be apparent what
I try to achieve - I would like to give the user the choice to submit a
form either to action1 or action2 but I cannot figure out how?! It would
be great if someone could give some assistance.
Thanks a lot, Alex
<%= start_form_tag :action1 => ''save'', :action2 =>
2006 Apr 03
3
render :partial + redirect_to :controller
This is of course disallowed, which I discovered only after nearly
completing my spanking new ajaxified UI. What is the motivation behind
this, and what is the best workaround?
This UI does a scriptaculous drag-and-drop of items from a first div
(div1) over to a second div (div2), which triggers the contents of div2
to be updated to reflect the drop. No prob, thus far. But then the
2009 Mar 05
4
before_filter :action_name OR :action_name
Hi there
I am wondering if we can use before_filter in the form of :action
OR :action
what i want to do is to implement one of the actions, if the first
failed, then go to the second
when i use
before_filter :action1
before_filter :action2
each method will run them, my case is that i want to check if one of
them is true and not both
any idea?
2006 Apr 10
3
form_remote_tag can only have one submit button?
I setup a form_remote_tag with several submit buttons, all of them share
the same name
( ''do_action'' ) and their values differ.
eg.
button1 named do_action with value ACTION1
button2 named do_action with value ACTION2,
etc
No matter which button I press the value passed is always the one
defined for the first of these buttons ( the correct value associated
with the pressed
2006 Jul 02
3
2 before_filters, only want one to render something
I have two before_filters for a few of my controllers. They are running
my own methods authorize and admin_authorize. authorize is called on
just about every action to make sure that a user is logged in.
admin_authorize is called on about 80% of the actions and is used to
make sure that a user is an administrator. If a user tries to access an
admin_authorize protected action without being
2004 Jan 21
2
[Fwd: Re: Comboot Menu]
Thanks for the comment. The next pass for a file format ...
------ FILE BEGINS -----
# Comment lines
[menu]
item="text to display"
status="status line text"
action= SUBMENU | INACTIVE | whatever
submenu= <number>
data="arbitrary string"
item="text to display"
status="status line text"
action= SUBMENU | INACTIVE | RUN | EXIT
submenu=
2006 Mar 30
5
Heeelp - no idea what''s going wrong.
I''m working on a simple CMS. The main data type are "listings" a listing
habtm (has_and_belongs_to_many) categories and subcategories.
Subcategories belong_to categories. Subcategories are basically the same
as categories, but they are treated differently in a few situations.
The problem is, I can''t seem to write the view/controller/model code
that allows me to
2006 Mar 14
6
How to provide 2 actions to a form?
Hi,
I have a form in rhtml. Now I have 2 buttons indside that form. Clicking
on the first button action will be ''create'' & on second button action
will be ''delete''. How to do this?
Thanx
Prash
--
Posted via http://www.ruby-forum.com/.
2006 Jul 11
1
Aggregate Controllers
Hi,
I''m developing a dashboard like page and basically want to combine the result of multiple actions on a page. I''ve done this so far:
def index
r1 = render_to_string :action => "action1"
r2 = render_to_string :action => "action2"
render :text => r1+r2
end
This works, but now I want to render from other controllers and this is where
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_
2006 Apr 15
8
Inheritance in Rails - I need some help
I''ve got a model, "category" and another model "subcategory." Each
subcategory belongs_to a category, and a category has_many
subcategories.
What I need to do is set it up so that I can search Category and
Subcategory with one .find call. So:
Category.find(:all, <etc)
will find categories and subcategories.
Now, I believe this can be done by making
2006 Jul 26
5
Restricting before_filter to certain actions?
Can you restric before_filter to specific actions?
--
Posted via http://www.ruby-forum.com/.
2006 Jan 06
3
Cookbook recipes eg - ordering categories in the recipe pull-down box
People,
I can order categories when looking at the categories list page but how
do I change the recipe page to list the categories in alpha order in the
recipe pull-down box?:
> <p><b>Category:</b><br>
> <select name="recipe[category_id]">
> <% @categories.each do |category| %>
> <option value="<%= category.id
2006 Sep 26
0
some help with functional testing of nested routes
I have the following functional test in test/functional for testing my
products_controller:
require File.dirname(__FILE__) + ''/../test_helper''
require ''products_controller''
# Re-raise errors caught by the controller.
class ProductsController
def rescue_action(e)
raise e
end
end
class ProductsControllerTest < Test::Unit::TestCase
fixtures
2005 Jul 07
2
0.13 ajax sortable lists and acts_as_list
I''m trying to figure out a good way to get acts_as_list and the new
sortable lists to play nicely together, but they don''t seem like
they''re designed to mesh well. The ajax sortable lists post a
complete ordered list of ids back to the server after every change,
but acts_as_list is designed to deal with diff-like changes, rather
than reordering the whole list from
2006 Apr 16
11
Best way to sort categories w/ pager
Ahoy,
I made this pager,
" def list
@item_pages = Paginator.new self, Item.count, 10, @params[''page'']
@items = Item.find :all, :conditions => "category_id =
#{params[:condition]}",
:limit => @item_pages.items_per_page,
:offset => @item_pages.current.offset
@categories = Category.find_all
2009 Aug 11
2
Bugzilla not working following RHEL to CentOS migration
Dear listmates,
I've recently moved a server from RHEL5 to CentOS 5.3 after it was
decided not to renew the subscripton. Everything works beautifully
except for Bugzilla, which throws MySQL errors. For example, the
sanitycheck.cgi page says:
# # #
Bugzilla ? Sanity Check
* Home
* | New
* | Search
* |
* | Reports
*
* | My Votes
* | Preferences
2006 Jul 07
5
Can a route require POST or GET? / REST problem with routing
Hi,
A store front a customer wants to GET /product/5/show. But for the
application this is really GET /cart_item/new/5 or even better
/cart_item/new?cart_item[product_id]=5
When the customer clicks add_to_cart they POST /product/5/show so that
the url doesn''t confuse the user when any validation errors occur. But
for the applicaiton this should be POST
2006 Apr 18
6
Linking one model to another
I have a User model and a Thing model. I want to link users with
things, so I have a migration that creates a permissions table with
user_id and thing_id. The migration works fine and gives me three
columns, I assume I need the permission''s ID so that I can delete it in
future.
Three questions come to mind though, which I have given thought but got
nowhere.
1) Does the