search for: some_action

Displaying 20 results from an estimated 39 matches for "some_action".

2006 Apr 10
1
routing
...... map.connect ":action/:id", :controller => "default_controller" .. It worked nicely, until I added a second controller to my project. The new (second) controller is "Admin". The problem is I cant reach the actions in the second controller. http://mysite.com/some_action is routed to some_action in default_controller. That is how I want it to be. But how do I reach admin_action in the Admin controller? This doesnt work, for obvious reasons: http://mysite.com/admin/some_action it gets routed to the undefined action admin in default_controller with id some_acti...
2006 Jan 22
6
*Very* basic layout question
I''m trying to use a different layout for just one action in my controller, all the other actions use the application.rhtml layout, so what i''m doing is ... class SomeController < ApplicationController layout "simple", :only=> :some_action ...... end and the "simple" layout is applied to all the actions, can someone please give me a hint? Thanks for everything. I''m loving rails so far, loving the comunity =).
2013 Mar 06
2
Refresh a partial onClick using ajax call in rails 3.x
...t;, success:function(data){ alert(data); $("ul#mymenu ul#mixed").html(data); }, error:function(data){ alert("Error"); } }); }); }); <body> <%= render(:partial => "partial", :object => @object) %> </body> contoller action def some_action @object = Class.where(some_condition) render :home do |page| page["#myMenu #mixed"].replace_html :partial => "event" :object=> @object end end partial _partial.html.erb <ul id="myMenu" class="contextMenu&qu...
2007 Dec 05
4
render :update and controller private methods
Probably asked and answered, but... Why are controller private methods inaccessible inside the block passed to render :update ? This does not work: class MyController < ApplicationController def some_action render :update do |page| page.replace_html ''an_element'', some_private_method end end private def some_private_method return ''data'' end end --~--~---------~--~----~------------~-------~--~----~ You received this message because you are...
2006 Jan 23
8
yield vs @content_for_layout, etc..
...In the 5min ajax video the presenter uses <%= yield %> in his layout. In the agile book, @content_for_layout is used. Since, yield is an actual Ruby construct, is it more efficient and preferred? What is the difference? Question 2: Links are often of the form :action => ''some_action'' However, I have also seen :action => :some_action Which form is preferred? Why does this work? How are they different? Question 3: Links often contain a link to an object. :id => @object which is really short for :id => @object.id. How is that conversion able to tak...
2008 Sep 02
4
Rescue rails errors
Hi all, Sometime, I get the following error in my application: ActionController::InvalidAuthenticityToken in ManageController#site_servers ActionController::InvalidAuthenticityToken I tried to put the code in manage controller between begin ... rescue ... end but it didn''t catch the error. So I tried in the application.rb controller, I put the forgery code between begin ... rescue ...
2006 Apr 26
6
Immediate help needed
I have posted this previously also but haven''t received any help. So, if somebody could look into it and guide.. I want to validate the extension of files that I am uploading. Like I want only the doc/pdf files to be uploaded.. Thanks in advance. -- Posted via http://www.ruby-forum.com/.
2006 Mar 29
4
using onchange options in forms
...rum where people hardcode the forms and use javascript to trigger the change (and nearly all have complained that it''s a hack) and I''m wondering if anyone has a more elegant solution using the embedded ruby methods? I''ve tried adding the "onchange"=>"some_action" argument to my select() but either I''m not using it properly or it doesn''t work. Does anyone have a nice solution using the select() method? (Or at least a way I could check if the html option listed above is actually working?) Thanks... Bry M. -- Posted via http://www...
2006 Jun 07
3
Getting values
What if I have this URL on my browser''s address bar? http://www.mysite.com/controller/rhtml/3 How can I put the "3" as a value inside the controller. Thanks, Jeremy -- Posted via http://www.ruby-forum.com/.
2006 Mar 30
4
SSL Requirement plugin
Is there any way to have the plugin require SSL to be used for all actions in a controller and just specify the ones you dont want to require SSL using ssl_allowed? class ApplicationController < ActiveRecord::Base include SslRequirement ssl_required *.* Many thanks. Also I could of course combine this with local.request? so that when developing locally http is allowed, but
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 Mar 17
2
Temporary Model Data
I am trying to optimize some methods in my model so they don''t repeat CPU intensive algorithms every time I call the method in the same request/response cycle. Eg. ================ def invitations all_pgm_updates.find_all do |update| update.invited? end end ================ I want to do something like: ================ def invitations if @invitations.nil?
2006 Apr 25
7
undefined method form_for ?
Seems the only issues I ever have with Rails are these bizarre fiddly little things that make no sense. Can''t for the life of me understand why I''m getting undefined method on form_for in a view? And it''s actually part of the acts_as_authenticated plugin that''s doing it. But how can it not know about form_for? -- Posted via http://www.ruby-forum.com/.
2009 Feb 09
3
can't call request.remote_ip from object?
class User def update_metadata self.update_attributes({:last_login_at => Time.now, :last_known_up => request.remote_ip, :last_known_user_agent => request.user_agent}) end This does not work. It bombs out with: undefined local variable or method `request'' for #<User:0x1e146e0> But the request calls work in a
2006 Mar 10
7
ODBC adapter connection help please.
Does anyone have any experience getting ODBC to work? I could really use some help here. I''m having trouble accessing a db2 database via odbc using rails. It''s an external database, that I import data from. I have placed the connection code in my model : unless connected? establish_connection( :adapter => "odbc", :dsn => "<dsn
2006 Jan 30
5
Action Mailer woes
Hi gang, Im having my first stab at ActionMailer and not having any luck. Perhaps someone could help me out. I generated a a mailer called ItemMailer - its purpose is to take some information that I''ve already gathered in a ToDo list form and to mail it out to the person who is nominated for the task In environment.rb I have; ActionMailer::Base.server_settings = { :address =>
2008 Feb 21
7
looping through a list
what is the proper way to loop through a list in a rails view (assuming that you need to check if it is empty or not) -- 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
2006 Jul 26
7
syntax for specifying :html fallback on form_remote_tag
Has anyone gotten the :html option for specifying a ''fallback'' action if javascript''s not enabled working on form_remote_tag (or remote_form_for)? I can''t figure out how to specify the action that''s supposed to be invoked if js _is_ enabled. Or maybe I''m just misunderstanding how this thing is supposed to work. I was assuming
2006 Jul 28
2
change url based on account name
Hi, Is this possible Can I specify a url ie http://localhost/AccountName/:contorller/:action/:id Where AccountName is should be a userName, which will lookup a siteId in the database? Whats the best way of going about this, is there somthing in the routes.rb file I can change to get the account name into a variable? Thanks for your help jon -- Posted via http://www.ruby-forum.com/.
2006 Apr 11
1
Implementing Optimistic Offline Lock - How ?
I understand that ActiveRecord supports the "optimistic offline lock"-pattern through magic fields (created_at, updated_at). However, a scaffolded CRUD-Controller doesn''t generate the necessary code to support this feature (the model state gets lost between two action calls). What is the best practice to prevent users from overwriting objects with outdated data ? --