Recent Posts by Brock
Pages: 1 2
|
Jul 17, 2007
|
Topic: Rails Talk Volunteer - Tagging & Tag Clouds If there is no hurry I would prefer end of summer or early fall. Summer is always a tough time for gatherings. I will do my best to make it whenever it is. |
|
Jul 17, 2007
|
Topic: Free Talk - Aug/9 - Web Services REST-Style: Universal Identifiers, Formats & Protocols I unfortunately will be in idaho for the week of the nineth. I am looking forward to such meetings in the future. |
|
Jul 5, 2007
|
Topic: Rails Talk Volunteer - Tagging & Tag Clouds Looks interesting Gerald. I have alway had a love affair with tagging. As for plugins, I prefer the has_many_polymorphs plugin. I also think the acts_as_taggable(gem) is nice to work with but is obviously limited by its lack of poly. |
|
Jun 26, 2007
|
Topic: Acts_as_authenticated multi-level users? It looks like a good Kyle. It looks like you are getting things figured out. |
|
Jun 20, 2007
|
Topic: uploading with file_column in a different controller/view sorry to leave you hanging. It looks like you are doing well. About the image uploads from diferent controller. The controller really has nothing to due with the file upload. This is done by the model. All file_column is doing for you really is allowing you to store the image in a folder outside of the database rather than in the database itself. As for your controller. You seem do have done a good job with keeping it orderly. Your next step in getting it cleaner is to move to a RESTful design. I think after this project you will see the benefit to REST witch will help you understand REST better. |
|
Jun 11, 2007
|
Topic: Rails hosting opinions the never ending rails question. Hosting. Personally I use Slicehost for everything because it gives me 100% flexability. The Upside is you get to configure everything. The downside is you have to configure everything. It starts at 20/month. This may be steep for your needs but you can always put more than one sites on a slice (as long as they dont get any serious traffic). For a low cost alternative, Site 5 will give you SSH access. They are one of they erlier adoptors of rails hosting and super cheap. The main downside with Site 5 is that scaleing is a bitch! it could work for your needs but dont ever but a “growing” app on their servers. Be careful. Every host company says they host rails. Its the new cool thing. Not all rails hosting is what I would call “real” rails hosting. good luck. |
|
May 25, 2007
|
Topic: linking tables through sessions wow man, you allways got something on the go. I liked your last app by the way. It looks like you are on the right track. I think you need to create a fouth table (called ‘cards’). Cards should have image_id , style_id , and body_id Then setup the following relationships in the model. Card
Image
Style
Body
This should get you started. |
|
May 23, 2007
|
Topic: June meetup Jeremy wont be back for a long while and Zed is in New York for the long haul. So its really up to us to keep things truckin. I would love to hear Brian experiences on deployment with Nginx. If Brian is too busy for that I can give a discussion on REST or RJS (or using RJS with RESTful controllers). |
|
May 18, 2007
|
Topic: Assigning Rights and Roles to Users Glad its working out for you. Is your app online? |
|
May 18, 2007
|
Topic: Assigning Rights and Roles to Users As for your problem of wanting to direct superusers to a special page. It should be as simple as adding an if statement in there. try this |
|
May 17, 2007
|
Topic: Assigning Rights and Roles to Users ok. lets take a look at the first issue of updating the user without reseting the password. It looks like you have a method in your model that encrypts the password. We will change this to only encrypt the password if the field in not blank. It looks something like this You should now be able to change the user details without altering the password. But we are not yet in the clear. Once you add validations to the password field it will not allow you to submit changes because it will not validate. For this I like the solution Mephisto uses… Step 1 – we are going to create a new method in the model that checks to see if a password is required. (password is required if the password is nil or not-blank)...
Step 2 – check if password is required upon validating. And that is done by calling the password_required method during each validation…
|
|
May 16, 2007
|
Topic: Assigning Rights and Roles to Users glad it worked. I figured this would be your next question. Do you mind showing me your user model? |
|
May 16, 2007
|
Topic: Assigning Rights and Roles to Users First of all let me say that I am impressed that you are using RESTful controllers. The answer to your question is simple. Have the edit method find the session user instead of the user found in the url. If you want a superuser to still be able to edit anyone, just check to see what their rank is first. |
|
May 12, 2007
|
Topic: limiting scope of loop Looks like you are close. The Querry in the controller should look like this.. @anouncements = Anouncement.find(:all, :order => ‘id DESC’, :limit => 5) |
|
May 3, 2007
|
Topic: May meetup Are we meeting tonight. I have not heard from Brian sense he made this post. |
|
Apr 30, 2007
|
Topic: May meetup Tonight (April 30), a few of us are meeting at The End Cafe at 7:00. The focus for the first hour will be on setting up Billing on Gerhards Apartment app. The focus for the second hour is getting Kyle’s first app ready for deployment. All are wecome. |
|
Apr 27, 2007
|
Topic: Assigning Rights and Roles to Users no you dont need to put that in you user controller. you have it in your session controller where it belongs. I think I may need to see your app in context to get the final bugs out. I am meeting with Gerhard on monday to give him some help with his app. Why dont you join us and I can take a look. We can make it an open hack session. Anyone can come to give/take advice. |
|
Apr 27, 2007
|
Topic: Assigning Rights and Roles to Users You did not include the methods in your Users Controller. It seems that that is where the error is occurring. |
|
Apr 26, 2007
|
Topic: Assigning Rights and Roles to Users you are right, there is a problem with that line. what unless session[:user_auth] > 1 does is check to see if session[:user_auth] is greater than 1. Part of the problem is that this needs to be changes to “rank” instead of “auth” So.. what we are going to do is in the login method. we are going to set… session[:user_rank] = user.rank then in the filter change it to… unless session[:user_rank] > 1 and make sure to then clear this param in the logout method. by going… session[:user_rank] = nil Sorry if I have confused you. If this still isnt clicking review the Agile book on how sessions work and look at what your login/logout methods are doing. Feel free to send me your app or paste your controllers in caboose |
|
Apr 25, 2007
|
Topic: Assigning Rights and Roles to Users When the user logs in you must set their rank in the session OR if you have chosen to only set the id of the user in your session you must do a find based on your user and then check his/her rank. currently the method assumes the rank is stored in the session. |
|
Apr 25, 2007
|
Topic: Assigning Rights and Roles to Users Yes. You have the right idea. If you only have two types of users at this point I would definitely keep it simple and use the rank method. add an integer field to your users table called auth. now lets say a member has a rank of 1 and admin is a 2. Our before filters (located in application controller) will look like this Authorize_1 just checkes to see if the person is logged-in (this means both member and admin have access if logged in). if not then they are redirected to the login page. authorize_2 first calls on authorize_1 and then checks to see if their auth is greater than 1. So at the top of your controller you would call before_filter :authorize_1 or before_filter :authorize_2 |
|
Apr 14, 2007
|
Topic: Assigning Rights and Roles to Users It looks like you have two ways you can do this. The first method is a raking system. Rank is determined by one field in the users table. You may make as many different levels of rank as you would like. but it works like this… Rank 1 can do task A Rank 2 can do task A and B Rank 3 can do task A, B, and C I think you get the Idea. The second method is more flexible but much more work. The only difference is that roles are not subject to rank. There can be any combination of roles to any person. To do this requires creating 4 new tables in your database. You can then do this… Person 1 can do task A (but not B) Person 2 can do task B (but not A) Person 3 can do task A, B, and C Person 4 can do task C and A (but not B) So it looks like you have a decision to make. This decision should be made on the basis of the needs of your application. I use method one in most cases because I love using simple solutions for complex problems but sometimes your authorization needs the flexibility that only the second method two can give. |
|
Apr 13, 2007
|
Topic: Assigning Rights and Roles to Users I have a pretty simple/novice way to deal with this. Here is the basic steps (details will follow). 1. Need an Integer value in Users model to track Authorization Level (such as auth) 2. In your view Add to your user form the ability to set/change authorisation level (I use a dropdown list from 1-3). 3. Use a before_filter in your controller to call a private method (located in the application controller) to determine if the user has high enough authorization level to access that controller. (this is much like the authorize method you have all ready but it accepts a parameter being the auth value ). This should get you started. I will give you more deatails later. |
|
Apr 13, 2007
|
Topic: May meetup That would be awesome Brian. I would love to learn more about all those topics. Wednesday works for me. |
|
Apr 10, 2007
|
Topic: Hellooooo?? I plan on makeing it. And Yes—A presentation on Globalization would be sweet. |
Pages: 1 2