search for: articlescontrol

Displaying 16 results from an estimated 16 matches for "articlescontrol".

2006 Dec 11
0
auth_generator 2.0.1 undefined method `login_required' for ... ArticlesController
I am a relative RubNub and attempting to implement auth_generator v.2.0.1. I am getting an "undefined method `login_required'' for #<ArticlesController:0xb732c0b4>" error when I attempt... http://localhost:3000/articles/new Help would be appreciated. My app/controllers/application.rb reads... ------------------------------------------------------------------------ require ''auth_system'' class ApplicationController...
2006 Apr 27
2
problematic admin/views
...min zone, here you can see my file structure: http://img284.imageshack.us/my.php?image=tmpviews6oq.gif and my admin controllers like this: controllers/admin/admin_controller.rb class Admin::AdminController < ApplicationController ... end controllers/admin/articles_controller.rb class Admin::ArticlesController < Admin::AdminController ... end both works fine, the problem are the views, for example the controllers/articles_controller.rb takes the view from views/layouts/articles.rhtml no problem, so the controllers/admin/articles_controller.rb should take the view from but views/admin/layouts/a...
2010 Dec 15
5
Having trouble testing :( "superclass mismatch" and can't load "test_helper"
I''m having trouble testing my Rails 3 application. Unit testing doesn''t work. If I try ruby article_test.rb directly, I get a "no such file to load" error, and if I try rake test:units or ruby unit/ article_test.rb I get this odd "superclass mismatch for class ArticlesController" error! I''m hoping I can get this settled... My test files were generated by the generator... C:\Users\Family\workspace\jdrampage\test\unit>ruby article_test.rb C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'': no such file to...
2007 Dec 03
18
Need help mocking this out
Let''s say you''re using the restful_authentication plugin. You have a model called articles. On the index action of the articlescontroller you simply want to spec out that it''ll scope the results to the ownership of the current_user. It should NOT include any articles other than the articles that user owns. How would you properly spec this out? Thanks for the help! -------------- next part -------------- An HTML attachm...
2005 Aug 17
4
Stop an action ?
...e your action, passing the domain as a parameter (domains are like a group of users with specific rights). For that purpose, I need to exit the action inside this method because it redirects to a login page if that person isn''t authentified. The only way I found on to do this is : class ArticlesController < ApplicationController def edit if not login_required("users") return false end ..... end end Is there a better way to do so, like calling something similar to exit() inside the login_required method ?
2008 Jul 01
8
Scaffolding: Create, Edit, Destroy in admin area
...ant administrators to write, edit or delete articles. So I wanted to move this parts to another, secured controller. The one controller to display articles is called articles :), the other is also called articles, but is located in a folder called "admin". The code looks like this: Admin::ArticlesController < ApplicationController. This works great. I can view the public area by http://localhost:3000/articles and the admin area by http://localhost:3000/admin/articles. But I''ve got problems with the routing: The named routes (?) generated by map.resources :articles (e.g. edit_article_pat...
2012 Apr 17
6
ActiveRecord with different Date/Time format
...ctiveRecord. So the steps would like 1. Read datetime from params map 2. Parse it with user''s preferred datetime format 3. Format datetime to the default format used by ActiveRecord 4. Replace current datetime in params with re-formatted datetime Here is a snippet of the controller class ArticlesController < ApplicationController before_filter :format_date_time, :only => [:create, :update] ... ... private def format_date_time datetime = params[:datetime] params[:datetime] = DateTime.strptime(datetime, pref_date_time_format).strftime(''%c'') end end...
2010 Aug 05
3
how to ? Rails 3 ActiveRecord eager loading and AREL
...els, article has many comments comment belongs to article Comment has a scope defined like this (app/models/comment.rb) : ---------------------------------------------- def recent where ["published_at >= ?", 2.days.ago] end ---------------------------------------------- In the ArticlesController (app/controllers/comments_controller.rb) : ---------------------------------------------- def index @articles = Article.includes(:comments) end ---------------------------------------------- In the view (haml) (app/views/articles/index.html.haml): ----------------------------------------...
2007 May 23
8
Rails Rendering diagnostics.rhtml in Controller Spec
Forgive me if this isn''t the proper list. It''s specific to the rSpec Rails plugin. The problem is, some controller actions are rendering the "diagnostics.rhtml" template when I''m expecting it to render something else in a controller spec. I''m assuming this is the template that displays the error message and a stack trace when an error is raised in the
2006 Apr 07
0
How to combine rjs with ActiveView::Helper?
Suppose in controller: class ArticlesController < ApplicationController def search ... render :update do|page| page.replace_html ''panel_tab_searchresults'',:partial => ''article'', :object =>@articles end end And i want to add ajax styled Paginator to the view,i have got...
2006 Apr 30
0
Role based auth recipe from a subfolder?
...r role based auth in the book, it works perfect(after sometime of pain to make it work fine), im using class inheritance to authenticate all the classes from one point(class AdminController in this case) i have this base structure: class AdminController < ApplicationController ... end class ArticlesController < AdminController ... end i define the following rights(by now i have only defined one role for easy implementation purpuoses) for the user: :controller :action articles list articles show articles edit ok, all of the above works perfect for any controller creat...
2010 Aug 16
0
assert_redirected_to partial assertion does not work?
...:controller => "weblog") will also match the redirection of redirect_to(:controller => "weblog", :action => "show") and so on But it my case it does not work. As assert_redirected_to(:controller => ''articles'') expects the index action of ArticlesController to be triggered. Any idea why I''m getting this behavior? -- 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 rubyonrails-talk-/JYPxA39Uh5TL...
2010 Oct 15
0
AssociationTypeMismatch / Model Caching in development envirnment
...nt me in the right direction. I''m having an issue where my model classes seem to be getting cached by something, and so if I make subsequent requests, I get an AssociationTypeMismatch error. To be specific, on update is where it fails, and I get: ActiveRecord::AssociationTypeMismatch in ArticlesController#update Category(#2159283720) expected, got Category(#2154954600) So sometimes this is successful, and the POST requests are identical. I can change the ''config.cache_classes = false'' to true in the config/environments/development to true and i won''t get the error any...
2014 May 16
0
(Beginner) ActionController::UrlGenerationError - No route matches
...:id(.:format) articles#show PATCH /articles/:id(.:format) articles#update PUT /articles/:id(.:format) articles#update DELETE /articles/:id(.:format) articles#destroy root GET / welcome#index My ArticlesController class has a method 'new' with empty body. I have views/articles/new.html.erb. When I manually enter the URL http://localhost:3001/articles/new in my browser, the correct page is shown. I had expected that my link_to call() would generate a link to that very page, but instead it throw...
2006 Jan 13
1
ActiveRecord: using with multiple threads/DB connections
...I read ActiveRecord is thread safe, but that''s not what I''m experiencing. Where does the synchronization take place? Again, I''m new to RoR so that may be stupid questions. Feel free to send me a RTFM, but please provide a link to said manual! ;) Thanks, Max class ArticlesController < ApplicationController ... def create @article = Article.new(params[:article]) if processNewArticle(@article) flash[:notice] = ''Article was successfully created.'' redirect_to :action => ''list'' else render :action => ...
2006 Jul 24
7
[PATCH] Support for DB Clusters/Replication in ActiveRecord (RFC)
Skipped content of type multipart/alternative-------------- next part -------------- Index: connection_adapters/abstract/connection_specification.rb =================================================================== --- connection_adapters/abstract/connection_specification.rb (revision 4617) +++ connection_adapters/abstract/connection_specification.rb (working copy) @@ -1,10 +1,21 @@ require