Which Rails Layout is Used after_filter
I need an after filter that will perform a query depending on what layout is chosen by the user for the current page. Is there a way to see what layout is being used before the page is rendered? Thanks. ...
I need an after filter that will perform a query depending on what layout is chosen by the user for the current page. Is there a way to see what layout is being used before the page is rendered? Thanks. ...
I have a question about where values in dropdowns are coming from: I have a migration that set up the original table with some initial values: add_column :contracts, :signature_status_id, :integer # lookup data sig = SignatureStatus.new(:name => "Delivered") sig.save! sig = SignatureStatus.new(:name => "Signed") sig.save! I have a t...
Hey folks, I have a few before filters which I am using to control access to resources on a resource-by-resource level. The basic idea is as follows: A user can be a user or admin and can have access to specific resources based on an "accesses" table. Resources/methods can be limited in access to admin, owner, particular users, or eve...
Because Shoe.color_equals('Dark Brown') != Shoe.color_equals('dark-brown') Is there a way to do something like: Shoe.parameterized_color_equals('dark-brown') Not that the api has to be exactly that, but is there a way to accomplish what I've outlined with searchlogic? edit I'll send in the GET params: dark-brown but want to match...
Hi, I have the following code @asset = Asset.first(:include => [:asset_statuses => [:asset_status_name, {:asset_location => [{:asset_floor => :asset_building}]}],:asset_type => [:asset_category => :asset_department]], (probably not the best DB table desing but that's what I have to use...) So, the Asset.first works correctly and it ...
Ok I have posted a couple of things that had to do with my problem but I think I have it narrowed down. Here is where I am at: I have my index.rhtml page inside of /views/main and the main_controller is set up correctly. I am attempting to make this page a dashboard of sorts so it needs to reference multiple other views to display their...
I get a application running over: Rails 2.3.5, Application is set 2.1.0 at enviroment.rb Ruby: 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.2.0] The Urls are generated right, but the resources like stylesheets, javascripts are generated with double slashes. <link href="http://127.0.0.1:3000//stylesheets/style.css?1254514155" medi...
I've been working on a web app that could be prone to user abuse, especially spam comments/accounts. I know that RECAPTCHA will take care of bots as far as fake users are concerned, but it won't do anything for those users who create an account and somehow put their spam comments on autopilot (like I've seen on twitter countless times). ...
I am building a project management app and need some help with how to pass a parameter (I think that is how you say it). Here is what I have going on. I have a table called "proposals" and "proposals" allow you to create multiple concepts per proposal. I have a table called "concepts" and on each "concept" the user can "comment". The w...
Hi, I have an idea for a large web application, which in my mind would really be a number of reasonably independent application "components" (?), e.g. forum, blog etc. It seems to me that it would be nice to open source some of the individual components for others, or myself in the future to use. Now clearly, I could write a basic for...
Could someone please explain MVC to me in Ruby on Rails, in layman terms. I am especially interested in understanding the Model in MVC (Can't get my head around the model) Thank you in advance. ...
Hi, I've been searching for hours now and haven't found anything that helps. What I want to do: I need to call the check_login-Method (as below), which needs parameters. redirect_to check_login_users_url( :user => {:name => input[1], :password => input [2] }, :stylesheet => 'scaffold', :method => :get) The point is that thes...
For some reason the rendering of a view is failing on the production server, however has worked fine on the local dev and staging server. In the app different accounts can have custom layouts and home page or use the default. Snippet from production server (where it is failing) Rendering template within layouts/accounts/default/layout...
The form_remote_tag seems to generate the correct html, but format.html is rendered instead of format.js. The two most common answers to format.html being rendered instead of format.js are renaming the file *.rjs to *.js.rjs and making sure the the javascript files are actually loaded. Both of these have been done. Let me know if ther...
Hi, I'm trying to set a cookie in one domain and access it from another. Is this possible? Here's what I'm doing in my app: In a controller, the test action is accessed via this url: http://myapp.com/account/test def test cookies[:foo] = { :value => 'something', :domain => 'myapp.heroku.com' } end In same controller...
I have a Rails web application with a select box: <%= select_tag :foo %> I'm looking to write a function in the controller which would populate this select box with some values. What code would I need to write in order to do that? The function is being invoked using observe_field: <%= observe_field :foo, :url => { :action => :popula...
HI friends, I have a situation where i have to convert a partial into string from Active-Record. Here is the code: Facebooker::Session.create(Facebooker.api_key, Facebooker.secret_key).send_email( facebook_user_id, "MAIL_SUBJECT", (:partial=>"some/partial") ) This is being called from a model. T...
hi all, i am not able to connect to Mysql database using ruby on rails framework. here is my running code. dbh = DBI.connect("DBI:Mysql:testdb:localhost", "root", "root") # get server version string and display it row = dbh.select_one("SELECT VERSION()") puts "Server version: " + row[0] i have in...
I want every single details from the file i upload.. i am using attachment_fu, and i want to know that when the image is been taken , what is ISO , and which model of camera were used ,, ,, In short i want all the detailed property of image ,, Is it possible ? how ? ...
i want to implement a digg-like vote up/down method in my rails application using ajax. and i found that link_to_remote can do just that. but i want to check whether there's already a vote by the current user so that no user can vote up twice or more. how can i do that - how can i return values based on some condition so that an forbidde...