similar to: Many renders in one view?

Displaying 20 results from an estimated 8000 matches similar to: "Many renders in one view?"

2006 Mar 09
7
How to restrict access to admin part of the page?
Hi! What is the easiest way to restrict access to some part of the page? In php i just put .htaccess and .htpasswd files in /admin folder and it worked. Now i''ve got one admin folder for controllers, one for views, public folder and i''m not really sure if it''s still possible. So what is the easiest way? I don''t have any user logging features on my site,
2006 Mar 08
3
attribute or instance method or what?
Hi! Uhm are attributes just something like additional members of a class, other than those that come from the names of columns in the table? I''ve got images table, which has ''name'' column. I''ve added support for creating thumbnails out of uploaded pictures and i''d like to have an easy way of accessing them in my views. How to do it? I.e. my image
2006 Mar 13
6
Specifying none/single/many conditions at the same time
Hi! It''s rather ruby question than rails... I have a single ''list'' action where i call paginate method. I can receive none, 1 or 2 variables that specify conditions for paginate method. How to write the code so i can call paginate without conditions if all conditions variable are nil, with a single condition if one of conditions variables is not empty and with 2 if
2006 Mar 14
5
How to display different images using ajax?
Hi! On my page i display one full size image and a list of thumbnails. I''d like to change the full size image with a full size version of a thumbnail, after clicking on one of them. How to write controller action, so it would update the image without reloading the whole page? It''s easy with text, but how to reload an image? -- Posted via http://www.ruby-forum.com/.
2006 Mar 08
19
Creating multiple rows with one form
Hello. I''ve been trying this out for the past two days and I can''t seem to get it. I''m going to have a page where you can upload x amount of images at once. Lets say 10 images need to be uploaded, all with a caption. I''d like to have a browse button to choose the file, then the caption. Now, if I put 10 of them in one form, fill them all out and submit, I get
2006 Mar 14
3
How to write ! version of non ! method?
Hi! How to write i.e. array.join! based on array.join method? -- Posted via http://www.ruby-forum.com/.
2006 Mar 14
3
How to save parent and child objects in a single action?
Hi! I''m struggling with it for a week. I posted a few similar posts that cleared up few things (thanks Mark!), but i still don''t know how to do it properly. What i''m trying to do is to create parent object and its many children (images - i tried using file_column, but it''s a topic for another post)using data from a single form. I''ve got a working
2006 Mar 22
4
How to write this SQL query?
Hi! Is there rails version of "where column in (value1, value2, ...)"? I know i could do OR many times, but this way is shorter. I''m ruby/rails newbie, so i have a problem with converting the hash, which i''m receving from the search form into the string for :conditions in find method. Could i instead of creating one, complicated (for me) query do something like
2006 Feb 18
5
Model methods and partial view templates
I have a method in a controller that invokes a render :partial => ''some_partial_view'' In that view, I''m trying to access a method defined in a model, like this; <% for view in @an_array %> <% local_var = view.some_method() %> <% another_var = view.a_column_name %> etc.. I am getting an undefined method error but the model is accessible
2006 Apr 21
1
Which internationalization plugin to choose?
Hi, I need to create rather simple page (gallery + news), but it has to be in 3 different languages (polish, english, german). Which plugin do you recommend? How to store translated data in the database - in a single table with separate field for every language or in separate table for every language? -- Posted via http://www.ruby-forum.com/.
2006 Mar 09
2
How to keep formatting of text in textarea?
Hi! I''ve got a form for creating news and i''d like to keep formatting of the text in the textarea - if user presses enter twice, or presses space ten times it should be visible when editing or showing the news. Probably i should add before_save filter and some regexps for adding html tags, but i know almost nothing about regexp. Maybe there''s a simpler way also.
2006 May 03
1
Globalize app example anywhere?
Hi! Is there anywhere tutorial how to create working application using globalize plugin? I need to create a site in 3 different languages and i was suggested to use globalize plugin. I''ve read a bit on globalize wiki page and pdf from the presentation available on the same page, but i still can''t figure out how to use it. 1. Can i translate names of models and columns
2006 May 25
7
Grouping controllers
I''m grouping controllers to avoid cluttering the top-level namespace. First, I used script/generate Admin::Customers new edit show list and then I used script/generate Admin::Providers new edit show list. The generator created the subfolders correctly: I have an admin folder and inside there''s customer_controller.rb and provider_controller.rb. I have the same structure in
2006 Mar 23
3
How to redisplay submitted data on validation error?
Hi! If i have an object it''s easy. But i''m making a simple contact form and i check if email address is correct. If it''s not i redisplay the form with the info that there was an error (should i use redirect_to or render :action? what''s the difference?), but all previously submitted data is lost. I tried creating variables using names of the form fields, but
2006 Feb 24
4
too many components?
okay. on /posts/show/13 i have show.rhtml, which does render_component(:controller=>''comments'', :action=>''display_comments'', :id=>post.id) on comments/display_comments i iterate through the comments and then, display_comments.rhtml render_component(:controller=>''comments'', :action=>''new'', :id=>@id)
2006 Feb 05
2
accessing the values in a view
trying to build an archive page in the controller layout file, i render_component(:action => "archive"), and that works fine. i turned render(:layout => false) within the "archive" function. trouble is, and here''s my confusion. as a test, i simply write def archive render(:layout => false) @archives = ''test'' end
2006 Mar 21
1
What is the difference between render partial and component?
What is the difference between the render(:partial => ''article'') and render_component? -- Posted via http://www.ruby-forum.com/.
2006 May 12
5
Implementing URLs with more than 3 levels in Rails.
Hi There I started using Rails recently, and I see it''s very easy for URLs that have up to 3 levels: /:controller/:action/:id But what do you do when you need more than 3? For example, my current project should have an "admin" interface. Admin has several sub-interfaces, for example a "users" interface. And the admin/users interface has several actions, e.g.
2006 Feb 16
9
calling a controller/action from another controller
Hi, Is there a way to call a controller/action pair from another controller as well as render the view for that pair? I have tried using "render ''ctrl/action''" and that works, but the controller code isn''t called (only the view is rendered). A redirect_to isn''t desirable either as I want the resulting content to be rendered in the current
2006 Feb 04
22
What''s the best way to embed a form?
I would like to embed my login form on my app''s home page. What''s the best way to render the login action of member controller from another action? Thanks Frank --------------------------------- Relax. Yahoo! Mail virus scanning helps detect nasty viruses! -------------- next part -------------- An HTML attachment was scrubbed... URL: