Streamlined now Postgres-enabled
Posted by jgehtland Sun, 27 Jan 2008 15:55:19 GMT
Streamlined is now proud to be 100% Postgres-compliant. If you are a Postgres user, Streamlined now does everything you want and has a full test suite to prove it.
Posted by jgehtland Sun, 27 Jan 2008 15:55:19 GMT
Streamlined is now proud to be 100% Postgres-compliant. If you are a Postgres user, Streamlined now does everything you want and has a full test suite to prove it.
Posted by Jason Rudolph Fri, 21 Dec 2007 21:54:54 GMT
If you grab the latest edge Streamlined bits, you’ll want to make sure you have the test/spec gem installed. All the tests now use test/spec’s describe-style goodness, but it will take a while still to convert all the tests to have more meaningful behavior-driven names.
Posted by Stu Fri, 27 Jul 2007 22:35:22 GMT
In the course of fixing a bug, I bit off of significant refactoring I have wanted to do for a while. Instead of saying this:
# old way class PoetUI < Streamlined::UI # declarative settings end
You can now say this:
# new way Streamlined.ui_for(Poet) do # declarative settings end
The new syntax is more testable, since it does not rely on singleton methods and inheritance. It also makes it much easier to break the default 1-1 relationship between models and ui instances. The old syntax is still supported, via a bit of method_missing trickery. But I am sure there are some breakages, and I would like to deprecate the old syntax over time. Kick the tires and let me know if you have any problems.
Posted by Luis Sat, 21 Jul 2007 05:13:01 GMT
Whenever I talk to someone about Streamlined, they usually ask about how they can customize the look. I’m going to cover how to change the look of the list / index view as of the state of the edge before the 0.9 release comes out.
You can do this by creating a UI class for your model by executing “rake streamlined:model MODEL=your_model_name”. This will create a ModelUI class in app/streamlined and affects the views for that model.
If you’ve tried Streamlined before, then you’ll know that when you’re viewing the list view for a model, then you’ll see a paginated table that contains all the instances of the model. Each row has one instance, along with three buttons: one to go to the show view of the instance, the second to go to the edit view of the instance and a third to delete the instance. Below the table, there’s a few more buttons with the most important one being the one to create a new model instance.
There’s already pretty good documentation on how to modify which columns show up, so I’m going to focus on the other options.
First, you can add custom headers and/or custom footers by adding the linesheader_partials :list => 'shared/my_custom_header'
footer_partials :list => 'shared/my_custom_footer'and then of course creating the header / footer partial and putting it in the place you specified. Second, you can turn off the delete button for each row. Perhaps you want to ensure that users delete from the show view or perhaps users should not delete instances of your model at all. Do this with
quick_delete_button falseThird, you can turn off the edit button for each row.
quick_edit_button falseFourth, if your model is read only, then you can turn off the new and edit buttons by adding the line
read_only trueNote that you can still delete, so you’ll have to specify quick_delete_button false like above if you want that. I’m not sure if that’s the right behavior. Any thoughts on that? Fifth, you can turn off all the buttons that link to show/edit/delete by adding the line
table_row_buttons falseSixth, you can turn off pagination via
pagination falseSeventh, you can turn off filtering via
table_filter falseEighth, you can add custom CSS styles via
style_classes :list => {:row => 'person_row'}
which means that each row will have a CSS class person_row which you can then specify in a stylesheet.
That’s it for customizing the list view declaratively. I’ll make sure all of this gets into the wiki. Please let me know if I missed anything. If there’s another way you’d like to customize the list view, please add a ticket in Trac or leave a comment here.
Posted by Matthew Mon, 25 Jun 2007 13:48:00 GMT
We’re excited to announce a new feature in Edge that will make it much easier to use Streamlined’s default actions while still having control over what gets rendered afterwards. Render filters allow you to tack additional code onto the end of a default action.
Matthew demonstrated these filters in a very early form at the Streamlined tutorial at RailsConf last month. They have since become much more useful and flexible. By using these filters, we’ve been able to stop copying and pasting default actions into our controllers only to make a single small change. Now, we can make the small change declaratively without redefining the action.
For example, what if you prefer that Streamlined redirect back to the list view instead of the show view after updating a record? You would add this render filter to your controller:
render_filter :update, :success => Proc.new {
redirect_to :action => 'list'
}
What this says is that the Streamlined’s default update action should redirect back to the list action on success. (Render paths can also be defined for failure.)
The contents of the Proc are called in the context of the controller action itself, allowing you to redirect, assign new instance vars, etc. (Pretty much anything you can do inside a controller action.)
More examples and documentation can be found on the wiki.
Posted by jgehtland Fri, 15 Jun 2007 14:55:19 GMT
Here’s some new features we’ve added in Edge, which are all documented over on the Wiki as well:
:options_for_selectattribute.
class PersonUI < Streamlined::UI
style_classes :list => {:row => 'person_row'}
end
Each row in the list (in LIST context only) will be wrapped in the CSS style “person_row”.And plenty more. Keep an eye on the Wiki and the Trac Timeline for more.
Posted by jgehtland Thu, 17 May 2007 01:52:05 GMT
We’ve just posted three new screencasts for the newest version of Streamlined, we hope you’ll enjoy them.
We’ll have many more online in the next few days, but here are the first. Enjoy! Feedback welcome!
Posted by jgehtland Mon, 07 May 2007 03:34:26 GMT
We’ve had a busy few weeks, so here’s an update on some of the new features we’ve added in Edge recently:
We’ve added the ability to denote a column as an enumeration. For example, in the sample project, an instance of Team has a column called :sport. It contains a string, but instead of being a free input, by making it an enumeration, the user is given a drop-down which provides them their options. The syntax looks like this:
user_columns :sport, {:enumeration => Sport.SPORTS}
The value passed to :enumeration can be any array.
In the original version of Streamlined, associations were only editable through Ajax from the list view. During create and edit, the associations were hidden. Now, associations can be edited from list, edit or create views, and by default, all three. To change that behavior, you can use any of the following options:
Usage:
user_columns :players, {:edit_in_list => false},
:coach, {:create_only => true},
:mascot, {:read_only}
Streamlined has long had a feature that attempts to detect if you have validations on an association that require it to be filled in. If so, Streamlined removes the “Unassigned” option from the drop-down, preventing the user being presented with an invalid choice. In Edge, we’ve expanded that behavior, and now you can provide a global or per-model override to the text “Unassigned”.
Usage:
user_columns :coach, {:unsassigned_value => 'None'}
You can now turn off per-row delete buttons in the list view by marking quick_delete_button as false.
Usage:
class TeamUI < Streamlined::UI quick_delete_button false end
You can also disable the display of the filter box on any list view by marking table_filter as false.
Usage:
class TeamUI < Streamlined::UI table_filter false end
That’s a pretty good list for now. We’ll be talking about more changes in upcoming posts. Don’t forget to check out the sample project for real examples of the plugin in action.
Posted by jgehtland Thu, 22 Mar 2007 14:32:25 GMT
First of all, thanks to everybody who jumped in on the beta and has been sending comments. We know the code is in high flux, and those who have stuck with it, we appreciate the feedback a lot. Thanks!
Second, I’d like to give some previews to the kinds of changes you will find when we release the new codebase. Perhaps most importantly to a lot of you, the declarative syntax for managing columns and relationships has been simplified and combined. You can expect your old version:
class EmployeeUI < Streamlined::UI
user_columns :name, :email, :hire_date
relationship :boss, {:summary => {:name => :name, :fields => [:first_name, :last_name]}
end
to look more like this:
class EmployeeUI < Streamlined::UI
user_columns :name, {:link_to=>{:action=>'edit'}},
:email,
:hire_date, {:read_only=>true},
:boss, {:show_view=> [:name, {:fields=>[:first_name,:last_name]}]}
edit_columns :name, :email
end
As you can see, relationship are combined into columns, and order is maintained across both. So if you moved :boss up to right after :name, the relationship column for :boss would be the second column in the list table.
Also, the optional overrides ‘edit_columns’ and ‘show_columns’ give you a way to specify those subviews. If not specified, they simply inherit from the list view.
You might also notice the addition of :link_to as an option for any column, which can take the standard url_for or RESTful url methods, or a raw URL.
Another major change is that we’ve changed the default behavior for editing/showing to non-Ajax. Instead of Prototype Windows being the default, we’ll use standard redirects. However, switching between the two types is as simple as including the right helper in your controllers. And the decision can be per-controller. For example:
class DepartmentsController < ApplicationController
acts_as_streamlined
include Streamlined::Helpers::PrototypeWindowsLinkHelper
end
That will switch the DepartmentsController to use the Prototype Windows-style edit and show behavior. Obviously, to change the style app-wide, you would just include that helper in ApplicationController.
That’s probably enough for this brain dump; look for all of this over on the Trac wiki today, with a downloadable sample project as well.
Posted by jgehtland Fri, 16 Mar 2007 17:58:55 GMT
We’re very pleased to announce the imminent release of Streamlined 0.1.0. We’ve been looking over the tickets, notes, comments, hate mail, etc. we’ve gotten and taken almost all of it to heart. Streamlined 0.1.0 is an entirely refactored codebase, and includes the following changes over 0.0.7.1:
These changes will lead to a host of new features over the next several weeks, including:
We’re looking for testers right now. If you are interested, contact us at contact AT relevancellc DOT com or on the dicsussion list and we’ll give you access to the subversion Edge branch. We’ll publicly release Edge at the end of next week, and go 0.1 the week after that.
We’re really excited about release, and, if you look at the changes in the codebase, we think you will be too.
Older Posts: 1 2